« Back to channel list

#RubyOnRails - 04 October 2018

« Back 1 day Forward 1 day »
[00:00:25] skangas: Very helpful stuff. Glad to see there's an active community around this framework!
[00:01:12] dogweather: Yep, there is. For sure, start with the Guides. They answer 95% of my questions.
[00:02:38] skangas: I'm 50 % done with "Agile Web Development with Rails 5.1" - I really like this book as a beginner. The guides are also very good, but I'm not fully through them yet.
[00:03:13] tdy: has joined #RubyOnRails
[00:06:46] lexileo: has joined #RubyOnRails
[00:19:07] prettybTech: has joined #RubyOnRails
[00:34:47] mr-spoon: has joined #RubyOnRails
[00:44:07] orbyt_: has joined #RubyOnRails
[00:46:39] helpa: has joined #RubyOnRails
[01:10:46] sevenseacat: has joined #RubyOnRails
[01:14:09] chouhoulis: has joined #RubyOnRails
[01:24:15] cagomez: has joined #RubyOnRails
[01:32:08] chouhoulis: has joined #RubyOnRails
[01:33:36] skangas: has joined #RubyOnRails
[01:51:26] orbyt_: has joined #RubyOnRails
[02:02:16] i8igmac: has joined #RubyOnRails
[02:02:47] i8igmac: this might sound dumb, but im working on a controller, and something tells me i should not put require 'tool' in the controller
[02:04:58] dtzuzu: has joined #RubyOnRails
[02:05:11] orbyt_: what is 'tool'
[02:05:22] i8igmac: well. its require 'set'
[02:06:08] i8igmac: im not sure how often the index_controller.rb is loaded, i guess it would be a petty little reoccurring require 'set'
[02:08:37] orbyt_: You don't need to require that
[02:08:42] orbyt_: it's already imported automagically
[02:38:30] quazimod1: has joined #RubyOnRails
[02:41:37] weaksauce: has joined #RubyOnRails
[02:45:19] rspades_: has joined #RubyOnRails
[02:46:36] DTZUZO_: has joined #RubyOnRails
[02:46:52] ivanskie: has joined #RubyOnRails
[02:47:53] tdy: has joined #RubyOnRails
[02:50:59] darkhanb: has joined #RubyOnRails
[03:01:16] ivanskie: has joined #RubyOnRails
[03:06:11] ivanskie: has joined #RubyOnRails
[03:09:23] braincrash: has joined #RubyOnRails
[03:19:48] srruby: has joined #RubyOnRails
[03:20:49] srruby: Is there a way to speed up tests by keeping Rails up ?
[03:27:21] havenwood: srruby: Spring is commonly used for that. There'll be parallel tests in Rails 6.
[03:35:35] ivanskie: has joined #RubyOnRails
[03:35:40] rspades_: has joined #RubyOnRails
[03:41:24] srinidhi: has joined #RubyOnRails
[03:49:56] za1b1tsu: has joined #RubyOnRails
[03:55:41] kapil____: has joined #RubyOnRails
[04:20:50] Exagone313: has joined #RubyOnRails
[04:21:49] xall: has joined #RubyOnRails
[04:28:08] duderonomy: has joined #RubyOnRails
[05:02:53] reber: has joined #RubyOnRails
[05:07:46] wethu: has joined #RubyOnRails
[05:10:02] quazimodo: has joined #RubyOnRails
[05:13:26] lessless: has joined #RubyOnRails
[05:13:45] lessless: has left #RubyOnRails: ()
[05:19:57] rspades_: has joined #RubyOnRails
[05:23:47] Xiti: has joined #RubyOnRails
[05:33:19] MoritaShinobu: has joined #RubyOnRails
[05:43:00] srinidhi: has joined #RubyOnRails
[05:43:48] srinidhi: has joined #RubyOnRails
[05:50:18] Motoservo: has joined #RubyOnRails
[05:55:36] Motoservo: I’ve tried the redmine group but it’s a ghost town these days. After a year away from coding I discovered my redmine (rails app) is down. I use a shared host (dreamhost) and I’ve tried reinstalling this but can’t seem to figure out why I only get a page that says “Redmine requires Bundler 1.5.0 or higher (you're using 1.3.5). Please update with 'gem update bundler'. (SystemExit)” I’ve found a few articles with ot
[05:55:37] Motoservo: having the issue, and some suggestions got them up and running. But they aren’t working for me. I’ve noticed a discrepancy between the web page that loads with the error I just pasted and the CLI. The CLI has been showing me my GEM_HOME in my rvm dir but the GEM_HOME on the project home page I’m trying to load that has this error, shows as GEM_HOME = /home/motoservo/.gems. Would this be why I’m getting an error?
[06:07:50] Motoservo: Also, isn’t it weird that I’m seeing a bunch of output related to my Gemfile on the web page that won’t load?
[06:08:19] Motoservo: I’m not a rails guy so not quite sure what’s going on. Just trying to get this Redmine rails app up.
[06:30:31] MrCrackPotBuilde: Hmmmm i defined an api's routes just using only the following namespace Api namespace V1 resources :articles. when i check rails routes it shows me the routes available but weird thing. The tutorial im following along with doesnt show a route for create action and i havent defined one. When i send my request using postman i get an exception message saying no action for create found. if i add def create to the controller below the index
[06:30:31] MrCrackPotBuilde: everything breaks.
[06:30:51] sevenseacat: define 'everything breaks'
[06:30:58] MrCrackPotBuilde: i guess why and how is the create funtion being used as the same route for index
[06:31:22] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[06:31:46] MrCrackPotBuilde: 1 sec im trying to recreate now to give more
[06:32:03] MrCrackPotBuilde: Prefix Verb URI Pattern Controller#Action
[06:32:03] MrCrackPotBuilde: api_v1_articles GET /api/v1/articles(.:format) api/v1/articles#index
[06:32:03] MrCrackPotBuilde: POST /api/v1/articles(.:format) api/v1/articles#create
[06:32:13] MrCrackPotBuilde: these are the two routes
[06:32:27] MrCrackPotBuilde: but no where have i defined a create route im guessing that is auto
[06:32:45] sevenseacat: resources :articles creates the whole set of routes
[06:32:57] MrCrackPotBuilde: in my controller i have def index which just orders the articles from created at desc
[06:33:05] sevenseacat: https://guides.rubyonrails.org/routing.html#crud-verbs-and-actions
[06:33:40] MrCrackPotBuilde: when i use as is without def create i get all my articles but an exception saying no create action. but i dont want a create action.
[06:34:04] sevenseacat: can you please gist the full error
[06:34:10] MrCrackPotBuilde: if i ADD the create action i get a 204 content error
[06:34:16] sevenseacat: as its hard to work out what you're talking about
[06:34:54] MrCrackPotBuilde: basically why do i get an exception error on the create action
[06:35:10] sevenseacat: without seeing your code and an error its impossible to say.
[06:35:13] MrCrackPotBuilde: when i make a get request on the index
[06:35:20] MrCrackPotBuilde: @articles = Article.order('created_at DESC');
[06:35:21] MrCrackPotBuilde: render json: {status: 'SUCCESS', message: 'Loaded articles', data: articles}, status: :ok
[06:35:26] sevenseacat: youre not listening.
[06:35:29] MrCrackPotBuilde: hahah thats why i dont want to gist
[06:35:35] MrCrackPotBuilde: its just two files
[06:35:44] MrCrackPotBuilde: articles controller article model
[06:35:58] sevenseacat: if you don't want to listen, you're not going to get help.
[06:36:00] MrCrackPotBuilde: the error i have said
[06:36:21] MrCrackPotBuilde: and exception create action not found
[06:36:43] sevenseacat: can you please gist the *full error with backtrace*.
[06:36:54] MrCrackPotBuilde: there is no backtrace
[06:37:00] MrCrackPotBuilde: its just a json responce
[06:37:16] sevenseacat: good luck then
[06:37:30] MrCrackPotBuilde: i get what you mean by the routes
[06:37:46] MrCrackPotBuilde: using resources created all the crud niceties for me
[06:44:41] MrCrackPotBuilde: stupid app for somereason my qt app fired both a post and get request thats why the error was coming in.
[06:47:00] MrCrackPotBuilde: it was sending the post first then the get. So because the first had an exception iin the json file it loaded that into the error box. then displaying the articles from the second request because thats what it was told to extract. So i was confuding the error with tsomething that it had nothing to do with hence the confusion
[07:04:26] MoritaShinobu: has joined #RubyOnRails
[07:11:20] tdy: has joined #RubyOnRails
[07:19:54] davidh38: has joined #RubyOnRails
[07:23:47] davidh38: has joined #RubyOnRails
[07:27:22] duderonomy: has joined #RubyOnRails
[07:40:30] davidh38: has joined #RubyOnRails
[07:41:06] sameerynho: has joined #RubyOnRails
[07:44:24] duderonomy: has joined #RubyOnRails
[07:55:45] trif: has joined #RubyOnRails
[08:04:25] lxsameer: has joined #RubyOnRails
[08:07:18] Psy-Q: it seems jsonapi-rb is unmaintained since mid-2017, is there another good thing for building jsonapi APIs?
[08:07:32] LiftLeft2: has joined #RubyOnRails
[08:08:03] roshanavand: has joined #RubyOnRails
[08:14:33] MIR100: has joined #RubyOnRails
[08:15:30] MIR100: has joined #RubyOnRails
[08:19:43] Charliebr73: has joined #RubyOnRails
[08:20:03] Charliebr73: Good morning from London.
[08:20:32] Charliebr73: Is anyone having issues with Rails tests failing on Travis when deploying to Heroku recently?
[08:20:58] sevenseacat: https://weblog.rubyonrails.org/2018/10/30/introducing-action-text-for-rails-6/ iiiiiiiinteresting (also, from the future)
[08:21:29] Charliebr73: I have a set of tests which passed fined last Thursday and now when deploying to Heroku, they are failing.
[08:22:15] Charliebr73: I am trying to push an update on the html code, it should not get even close to affect the tests.
[08:22:49] Charliebr73: Also, I saw that Travis released some updates six days ago hence my asking whether someone else is having any issues with it.
[08:25:57] roshanavand: has joined #RubyOnRails
[08:42:14] LiftLeft2: has joined #RubyOnRails
[08:45:15] rebreak: has joined #RubyOnRails
[08:49:03] uksio: has joined #RubyOnRails
[08:52:10] tdy: has joined #RubyOnRails
[08:58:59] dogweather: has joined #RubyOnRails
[09:01:19] davidh38: has joined #RubyOnRails
[09:05:55] mr-spoon: has joined #RubyOnRails
[09:15:42] Pupeno: has joined #RubyOnRails
[09:22:10] sheepman: has joined #RubyOnRails
[09:25:32] dogweather: I'm skeptical about the Shoulda Matchers. Anyone else?
[09:27:38] dogweather: I don't see why I'd use them - they seem to be operating at the exact same level as Rails code. Essentially duplicating it without asserting anything new
[09:27:54] Radar: You're right.
[09:28:18] dogweather: E.g., the ActiveModel matchers - that's where i really see the redundancy
[09:28:41] sevenseacat: I don't like some of what they do, but for model stuff, having the double-check can be useful
[09:28:47] sevenseacat: if you don't want to use them, don't use them :)
[09:30:00] dogweather: I think the check should be in the form of actual boundary values - e.g., valid and invalid values - seeing if they're handled properly
[09:30:27] sevenseacat: thats what the matchers do, no?
[09:31:30] sevenseacat: if you expect a field to validate_numericality_of a field, it'll stuff non-numbers in there and make sure it handles it properly
[09:34:03] ur5us: has joined #RubyOnRails
[09:35:06] tbuehlmann: oh? I thought it just checks for an existing validation with the given options
[09:35:37] dogweather: Exactly - it's not clear what they're testing
[09:35:53] dogweather: the source code didn't help me much ;-)
[09:36:19] dogweather: But the `allow_value` matcher is a good one - it works at a higher level of abstraction
[09:38:14] sevenseacat: tbh I'd err on the side of tests being dumb
[09:38:35] dogweather: `have_db_column` also makes sense because we don't declaratively set up db columns in Rails
[09:38:46] sevenseacat: I mean, you don't have tests for your tests, so smart tests are more likely to have bugs
[09:39:01] dogweather: yep, that's true
[09:39:09] dogweather: Mutation testing can help
[09:40:20] tbuehlmann: I only see value in such shoulda matchers as documentation
[09:40:36] tbuehlmann: they are really good for that
[09:46:54] davidh38: has joined #RubyOnRails
[09:47:21] Pupeno: dogweather: I'd tend to agree. I prefer my testing code to be closer to just plain ruby code, hence not a fan of neither rspec nor shoulda-matchers. I do find that shoulda-context helps a lot with tests that have common parts. I'm a fan.
[10:06:59] jkprg: has joined #RubyOnRails
[10:24:44] tdy: has joined #RubyOnRails
[10:48:42] lankanmon: has joined #RubyOnRails
[10:55:42] ariedler: has joined #RubyOnRails
[10:55:50] rspades_: has joined #RubyOnRails
[10:57:15] roshanavand: has joined #RubyOnRails
[11:05:33] davidh38: has joined #RubyOnRails
[11:11:43] rspades: has joined #RubyOnRails
[11:29:07] Kilo`byte: has joined #RubyOnRails
[11:29:49] Tempesta: has joined #RubyOnRails
[11:32:08] roshanavand: has joined #RubyOnRails
[11:36:13] simmerz: has joined #RubyOnRails
[11:43:29] schneider: has joined #RubyOnRails
[11:47:20] sitheris: has joined #RubyOnRails
[11:48:36] sitheris: hello all, I am quite new to rails and have been building my first application for the past few months. My code has smell and I want to refactor, does anyone know of good guides on this? Or where to start? I'm reckoning starting with views would be the best place to start refactoring but appreciate any tips
[11:49:28] dionysus69: if you want cleaner views go with slim
[11:49:47] sitheris: thanks I'll check out rubocop
[11:50:12] sitheris: my first stab at it i ended up building some partials out of my views, but there is still a bit of business logic in them yet
[11:50:32] dionysus69: it needs some initial configuration but after that you are good. it can integrate with any text editor I think. I use sublime
[11:51:21] dionysus69: well, rubocop won't know what content the code has in the view, so it cannot help with that part
[11:52:01] sitheris: cool thanks
[11:52:31] sitheris: am i going down the right path though? from what I've read I should move business logic out of the views to helpers/decorators?
[11:52:49] universa1: sitheris: that is the general consensus iirc ;)
[11:53:01] universa1: helpers, decorators, presenters, view models, ...
[11:53:07] sitheris: nice, thanks!
[11:55:19] universa1: sitheris: probably also look for specific problems you are solving and check if there are blog posts, video-casts about that (stuff like railscasts, and so on...) -- usually one can see and learn some little tidbits from there
[11:56:24] sitheris: cool thanks. stackoverflow has been my savior so far :p
[12:07:01] sitheris: has joined #RubyOnRails
[12:07:05] kapil____: has joined #RubyOnRails
[12:08:22] roshanavand: has joined #RubyOnRails
[12:10:14] rebreak: has joined #RubyOnRails
[12:25:28] davidh38: has joined #RubyOnRails
[12:30:11] akosednar: has joined #RubyOnRails
[12:33:40] NL3limin4t0r: has joined #RubyOnRails
[12:36:23] lexileo: has joined #RubyOnRails
[12:39:30] Dimik: has joined #RubyOnRails
[12:41:58] srinidhi: has joined #RubyOnRails
[12:51:11] rspades: has joined #RubyOnRails
[12:56:54] crova: has joined #RubyOnRails
[12:58:54] crova: How is it going folks? I'm having a hard time discovering what the backslash and inner double-quotes means here => wm: "\"SENT\"". I'm getting all my strings with those characters from a csv file and I would like to understand what it is and how to get rid of it and have only => wm: "SENT"
[13:05:57] tdy: has joined #RubyOnRails
[13:11:59] tbuehlmann: that's exactly that, just written as a string literal
[13:12:40] tbuehlmann: think this: how do you insert double quotes into a literal string using double quotes?
[13:33:07] Charliebr73: has joined #RubyOnRails
[13:34:00] apparition: has joined #RubyOnRails
[13:37:59] crova: tbuehlmann, gotta escape it somehow, with backslashes, right? I guess I see what you mean
[14:08:55] wojnar: has joined #RubyOnRails
[14:11:59] davidh38: has joined #RubyOnRails
[14:25:45] desperek: has joined #RubyOnRails
[14:28:30] GeneralDiscourse: has joined #RubyOnRails
[14:29:35] desperek: has joined #RubyOnRails
[14:34:31] [spoiler]: has joined #RubyOnRails
[14:50:42] roshanavand: has joined #RubyOnRails
[14:52:54] maxmanders: has joined #RubyOnRails
[14:55:10] sameerynho: has joined #RubyOnRails
[14:56:08] rspades: has joined #RubyOnRails
[15:06:31] Saukk: has joined #RubyOnRails
[15:09:05] srinidhi: has joined #RubyOnRails
[15:13:34] troys: has joined #RubyOnRails
[15:17:57] conta1: has joined #RubyOnRails
[15:35:50] tdy: has joined #RubyOnRails
[15:39:04] chouhoulis: has joined #RubyOnRails
[15:45:23] mikecmpbll: has joined #RubyOnRails
[15:51:32] ivanskie: has joined #RubyOnRails
[15:55:37] conta1: has joined #RubyOnRails
[15:58:22] ivanskie: has joined #RubyOnRails
[16:03:33] duderonomy: has joined #RubyOnRails
[16:08:25] orbyt_: has joined #RubyOnRails
[16:19:02] duderonomy: has joined #RubyOnRails
[16:24:54] orbyt_: has joined #RubyOnRails
[16:26:37] duderonomy: has joined #RubyOnRails
[16:29:33] duderonomy: has joined #RubyOnRails
[16:34:13] platoon23: has joined #RubyOnRails
[16:43:09] srinidhi: has joined #RubyOnRails
[16:45:21] dogweather: has joined #RubyOnRails
[16:45:47] darkhanb: has joined #RubyOnRails
[16:50:21] sameerynho: has joined #RubyOnRails
[16:51:22] duderonomy: has joined #RubyOnRails
[17:04:45] sitheris: has joined #RubyOnRails
[17:09:47] prettybTech: has joined #RubyOnRails
[17:13:18] snuz: has joined #RubyOnRails
[17:17:26] ivanskie: has joined #RubyOnRails
[17:22:34] ivanskie: has joined #RubyOnRails
[17:29:50] shynoob: has joined #RubyOnRails
[17:32:35] shynoob: so I hear.. that most rubyonrails developers have this notion of building websites.. or web application.. as this is the only good way.. is that true?
[17:33:45] shynoob: if yes.. do point me in the direction.. if I'd want to educate myself into understand this way .. thanks!
[17:35:20] havenwood: shynoob: I don't understand. Are you asking if Rails is the only good way to build web apps?
[17:35:47] havenwood: shynoob: The Rails docs are great if you're interested in getting started with Rails.
[17:35:49] havenwood: shynoob: https://guides.rubyonrails.org/getting_started.html
[17:36:18] shynoob: havenwood : I heard that rubyonrails dev think it's the right way to do it?
[17:36:29] shynoob: is that true?
[17:37:13] havenwood: shynoob: A common philosophy in Ruby is TIMTOWTDI (There Is More Than One Way To Do It).
[17:37:37] prettybTech: has joined #RubyOnRails
[17:37:42] shynoob: but havenwood thats within ruby?
[17:39:18] shynoob: havenwood: Is that the official documentation?
[17:39:38] shynoob: or official guide from the makers of the rails framework.. or
[17:40:07] shynoob: and also I don't really know ruby language!
[17:40:24] shynoob: I know bits of C tho
[17:52:51] Saukk: has joined #RubyOnRails
[18:05:51] tdy: has joined #RubyOnRails
[18:10:05] shenghi: has joined #RubyOnRails
[18:14:32] duderonomy: has joined #RubyOnRails
[18:16:14] davidh38: has joined #RubyOnRails
[18:16:40] davidh38: has joined #RubyOnRails
[18:18:47] roshanavand: has joined #RubyOnRails
[18:23:57] roshanavand: has joined #RubyOnRails
[18:29:31] mikecmpbll: has joined #RubyOnRails
[18:34:20] simmerz: has joined #RubyOnRails
[18:34:31] shynoob: has left #RubyOnRails: ()
[18:59:40] defsdoor: has joined #RubyOnRails
[19:03:56] ivanskie: has joined #RubyOnRails
[19:32:11] prettybTech: has joined #RubyOnRails
[19:37:47] simmerz: has joined #RubyOnRails
[19:47:51] rrichardsr3: has joined #RubyOnRails
[20:01:32] ivanskie: has joined #RubyOnRails
[20:10:47] dviola: has joined #RubyOnRails
[20:10:49] za1b1tsu: has joined #RubyOnRails
[20:17:59] lexileo: has joined #RubyOnRails
[20:24:04] fragamus: has joined #RubyOnRails
[20:27:05] simmerz: has joined #RubyOnRails
[20:35:55] tdy: has joined #RubyOnRails
[20:46:05] MrPunkin: has joined #RubyOnRails
[21:02:45] lxsameer: has joined #RubyOnRails
[21:08:30] davidh38: has joined #RubyOnRails
[21:14:36] fragamus: has joined #RubyOnRails
[21:15:30] BloopMonster: has joined #RubyOnRails
[21:21:56] EXCHGR: has joined #RubyOnRails
[21:37:07] prettybTech: has joined #RubyOnRails
[21:44:30] IanMalcolm: has joined #RubyOnRails
[21:44:45] MoritaShinobu: has joined #RubyOnRails
[21:48:31] borodin: has joined #RubyOnRails
[21:53:58] EXCHGR: has joined #RubyOnRails
[22:19:54] EXCHGR: has joined #RubyOnRails
[22:53:51] davidh38: has joined #RubyOnRails
[22:57:27] tdy: has joined #RubyOnRails
[22:59:18] ellcs: has joined #RubyOnRails
[23:16:21] dviola: has joined #RubyOnRails
[23:18:35] prettybTech: has joined #RubyOnRails
[23:28:18] DTZUZO: has joined #RubyOnRails
[23:49:49] knight33: has joined #RubyOnRails
[23:57:46] chouhoulis: has joined #RubyOnRails