« Back to channel list

#RubyOnRails - 07 February 2018

« Back 1 day Forward 1 day »
[00:13:44] tanuki: has joined #RubyOnRails
[00:15:39] chouhoulis: has joined #RubyOnRails
[00:18:38] mr-spoon: has joined #RubyOnRails
[00:21:08] guacamole: has joined #RubyOnRails
[00:30:22] chouhoulis: has joined #RubyOnRails
[00:44:36] alfiemax: has joined #RubyOnRails
[00:50:07] kapil___: has joined #RubyOnRails
[01:21:19] mikecmpbll: has joined #RubyOnRails
[01:21:54] sevenseacat: has joined #RubyOnRails
[01:24:17] someish: has joined #RubyOnRails
[01:28:02] cagomez: has joined #RubyOnRails
[01:28:28] mtkd: has joined #RubyOnRails
[01:34:23] apparition: has joined #RubyOnRails
[01:42:21] orbyt_: has joined #RubyOnRails
[01:45:57] workmad3: has joined #RubyOnRails
[02:00:21] Barrt: has joined #RubyOnRails
[02:12:22] alfiemax: has joined #RubyOnRails
[02:41:35] orbyt_: has joined #RubyOnRails
[02:44:06] Jameser: has joined #RubyOnRails
[02:48:19] Jameser: has joined #RubyOnRails
[02:59:59] dmarr: has joined #RubyOnRails
[03:00:11] Jameser: has joined #RubyOnRails
[03:06:24] alfiemax: has joined #RubyOnRails
[03:07:16] xcesariox: has joined #RubyOnRails
[03:07:43] alfiemax_: has joined #RubyOnRails
[03:09:14] glassresistor: has joined #RubyOnRails
[03:17:31] za1b1tsu: has joined #RubyOnRails
[03:21:00] b3rnd: has joined #RubyOnRails
[03:30:27] dviola: has joined #RubyOnRails
[03:32:20] mtkd: has joined #RubyOnRails
[03:40:08] darkhanb: has joined #RubyOnRails
[03:49:31] glassresistor: has joined #RubyOnRails
[03:56:17] ahrs: has joined #RubyOnRails
[04:00:20] Saukk: has joined #RubyOnRails
[04:16:47] sevenseacat: has joined #RubyOnRails
[04:25:14] trautwein: has joined #RubyOnRails
[04:26:35] xcesariox: has joined #RubyOnRails
[04:27:44] fcser__: has joined #RubyOnRails
[04:31:41] ewilliam: anyone understand why this happens: https://gist.github.com/ewilliam/2b05291f02624af1fb82016897d07e74
[04:32:01] ewilliam: trying to call polymorphic relations via has_many through
[04:32:58] ewilliam: the SQL is off. should be "steps" instead of "scheme_steps"
[04:33:09] ewilliam: for the scheme.steps call
[04:33:47] Radar: ewilliam: where should it be there?
[04:33:58] Radar: SELECT 1 AS one FROM "scheme_steps" INNER JOIN "scheme_steps" "scheme_steps_steps" ON "scheme_steps"."id" = "scheme_steps_steps"."steppable_id" WHERE "scheme_st
[04:33:58] Radar: eps_steps"."scheme_id" = $1 AND "scheme_steps_steps"."steppable_type" = $2 LIMIT $3
[04:34:06] Radar: Point to the exact place please and Dr. Radar will fix it.
[04:34:36] ewilliam: the SELECT FROM statement
[04:34:50] ewilliam: compare that one to the scheme.step_groups call
[04:35:03] ewilliam: it looks at "step_groups" table which is correct
[04:36:35] Radar: I am not sure why it is making that query.
[04:36:47] Radar: I think I'd need to see it happening in an app of my own.
[04:38:03] ewilliam: bummer.. im suspecting it might be a conflict between Step.rb and Scheme::Step.rb
[04:38:58] Radar: Very likely.
[04:39:17] Radar: ewilliam: Try changing this: https://gist.github.com/ewilliam/2b05291f02624af1fb82016897d07e74#file-scheme-rb-L6 to ::Step instead.
[04:39:32] Radar: That should reference the top level class.
[04:39:45] zave: has joined #RubyOnRails
[04:43:05] ewilliam: Radar: https://gist.github.com/ewilliam/2b05291f02624af1fb82016897d07e74#file-rails-console-2
[04:43:05] ewilliam: :: breaks query
[04:43:48] Radar: Isn't that now referencing the right table though?
[04:43:58] Radar: "SELECT 1 AS one FROM "steps" vs "SELECT 1 AS one FROM "schema_steps"
[04:44:18] ewilliam: but because the array input changes, it breaks
[04:44:20] Radar: I am not understanding then how the query is broken. Looks fixed to me?
[04:44:36] Radar: Oh, ["steppable_type", "::Step"] this part?
[04:44:44] ewilliam: that part, sorry
[04:44:53] Radar: Yeah that is not great.
[04:45:15] ewilliam: is that a bug?
[04:45:31] Radar: It's doing what you tell it to do, so I think not.
[04:45:41] ewilliam: i'll need to try this in a clean app
[04:45:43] Radar: You could work around this by renaming the Schema::Step class to be Schema::SchemaStep.
[04:45:55] Radar: I am not sure for the syntax to refer to the top-level class using a string
[04:46:08] Radar: If you have a clean app that repros this I would be happy to take a look at that too
[04:46:22] ewilliam: ok ill report back. thanks
[04:47:38] Axsuul: has joined #RubyOnRails
[04:50:41] xcesariox: has joined #RubyOnRails
[04:56:10] za1b1tsu: How can I use a form with openstruct?
[04:59:51] Cache_Money: has joined #RubyOnRails
[05:10:26] za1b1tsu: undefined local variable or method console did you mean controller in a view
[05:10:33] za1b1tsu: how is this possible?
[05:15:34] Radar: za1b1tsu: I bet that you're referencing an undefined local variable or method called "console"
[05:16:40] Radar: za1b1tsu: !rule3
[05:16:40] helpa: za1b1tsu: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[05:17:49] tanuki: has joined #RubyOnRails
[05:20:05] inradius: has joined #RubyOnRails
[05:20:10] xcesariox: has joined #RubyOnRails
[05:20:30] _aeris_: has joined #RubyOnRails
[05:22:58] inradius: I'm following this guide on creating a calendar, but unfortunately it doesn't really explain lots of things. https://richonrails.com/articles/building-a-basic-calendar-in-ruby-on-rails I was wondering if someone can explain why we can call "Date.today" or "Date.year" or "Date.month" even though it wasn't explicitly defined anywhere?
[05:31:25] xcesariox: may i ask how do i use back rails 5.1.4, i did gem update and it updated it to 5.2.0rc1 instead of 5.1.4
[05:31:38] Tempesta: has joined #RubyOnRails
[05:44:46] kapil___: has joined #RubyOnRails
[05:45:17] srinidhi: has joined #RubyOnRails
[05:47:38] workmad3: has joined #RubyOnRails
[05:49:14] Radar: inradius: it comes from the Date library, which is built into Ruby.
[05:49:23] Radar: (but first has to be required with `require 'date'`
[05:55:46] xcesariox: has joined #RubyOnRails
[06:00:47] greengriminal: has joined #RubyOnRails
[06:18:08] zave: hi all, anyone know of some good examples of making a basic auth http request programmatically with ruby? i keep getting a 401 This request requires HTTP authentication error. it works via the browser though.
[06:29:31] hahuang65: has joined #RubyOnRails
[06:43:19] hahuang65: has joined #RubyOnRails
[06:44:54] schneide_: has joined #RubyOnRails
[06:46:39] LateralO1: has joined #RubyOnRails
[06:51:21] xcesariox: has joined #RubyOnRails
[06:52:08] alfiemax: has joined #RubyOnRails
[06:59:33] defsdoor: has joined #RubyOnRails
[07:05:14] xcesariox: may i ask how do i use back rails 5.1.4, i did gem update and it updated it to 5.2.0rc1 instead of 5.1.4
[07:06:18] apeiros: has joined #RubyOnRails
[07:07:23] hahuang65: has joined #RubyOnRails
[07:16:22] boxmein: has joined #RubyOnRails
[07:19:43] hahuang65: has joined #RubyOnRails
[07:30:39] baweaver: if cesario comes back someone tell them to change the version in their Gemfile and `bundle update rails`
[07:30:52] dionysus69: has joined #RubyOnRails
[07:30:57] baweaver: and as a general tip: bundle update is dangerous unless you have some good tests
[07:30:58] xcesariox: has joined #RubyOnRails
[07:31:17] baweaver: Some gem authors are kind enough to make horrifically breaking changes on patch versions
[07:31:26] baweaver: ACTION glares at Rainbow
[07:34:29] sevenseacat: people need to learn this the hard way.
[07:34:55] sevenseacat: 'patch updates can't possibly brea.... oh.'
[07:35:30] hahuang65: has joined #RubyOnRails
[07:44:44] conta: has joined #RubyOnRails
[07:45:18] hahuang65: has joined #RubyOnRails
[07:55:53] DoubleMalt: has joined #RubyOnRails
[08:01:19] apeiros: has joined #RubyOnRails
[08:05:02] schneide_: has joined #RubyOnRails
[08:05:35] hahuang65: has joined #RubyOnRails
[08:05:37] srinidhi: has joined #RubyOnRails
[08:09:52] dminuoso: baweaver: And by *gem authors you include *ruby authors too right?
[08:10:36] arBmind: has joined #RubyOnRails
[08:12:09] DrYockel: has joined #RubyOnRails
[08:17:03] schneide_: has joined #RubyOnRails
[08:18:59] gr33nw00d: has joined #RubyOnRails
[08:19:12] gr33nw00d: Hi. Has anyone experience MySQL deadlocks with counter_cache?
[08:24:43] hfp_work: has joined #RubyOnRails
[08:25:51] hammer065: has joined #RubyOnRails
[08:36:06] b3rnd: has joined #RubyOnRails
[08:36:12] hahuang65: has joined #RubyOnRails
[08:40:37] dionysus69: has joined #RubyOnRails
[08:44:54] Radar: GOOD EVENING
[08:45:12] Radar: bring out ur dead
[08:47:15] LateralOctober: has joined #RubyOnRails
[08:47:51] hammer065: has joined #RubyOnRails
[09:15:37] alfiemax: has joined #RubyOnRails
[09:24:33] schneide_: has joined #RubyOnRails
[09:26:37] mikecmpbll: has joined #RubyOnRails
[09:32:19] sevenseacat: has joined #RubyOnRails
[09:32:22] kapil___: has joined #RubyOnRails
[09:37:30] hahuang65: has joined #RubyOnRails
[09:46:25] mtkd: has joined #RubyOnRails
[09:49:17] workmad3: has joined #RubyOnRails
[09:51:01] one_zero: has joined #RubyOnRails
[10:01:33] ikaji_xu: has joined #RubyOnRails
[10:01:33] dminuoso: HALLO RADAR
[10:04:05] mikecmpb_: has joined #RubyOnRails
[10:04:53] b3rnd: has joined #RubyOnRails
[10:08:15] Andr3as: hello everyone
[10:08:40] Andr3as: i am getting a Unsupported argument type: ActionController::Parameters error when trying to deliver_later an email... i am stuck, a bit
[10:08:56] Andr3as: here's a gist... https://gist.github.com/awunder/b8fca8180168b264d78759b4ca182837
[10:09:05] Andr3as: anyone an idea?
[10:09:10] schneide_: has joined #RubyOnRails
[10:10:35] tbuehlmann: Andr3as: activejob cannot serialize AC::Parameters objects, so that won't work
[10:11:32] Andr3as: tbuehlmann: how could i do that? split the params in instance variables and throw it to the new_message method?
[10:11:58] Andr3as: even though i dont get whats the issue it has with that...
[10:13:20] dminuoso: Andr3as: Turn it into an unsafe hash first.
[10:13:23] tbuehlmann: coercing the object to a hash should work, as in contact_params.to_hash
[10:13:33] dminuoso: tbuehlmann: *to_unsafe_hash
[10:14:04] tbuehlmann: I just tested and using to_hash works with a permitted AC::P
[10:14:06] b3rnd: has joined #RubyOnRails
[10:14:19] dminuoso: tbuehlmann: Old Rails version?
[10:14:23] tbuehlmann: I remember that method didn't always work and one had to use unsafe coercing
[10:14:32] tbuehlmann: not that old, 5.1.4
[10:14:39] Andr3as: fwiw i tried usafe_hash and it worked
[10:14:57] Andr3as: to_h worked as well
[10:15:04] Andr3as: so you were both right ;)
[10:15:06] dminuoso: tbuehlmann: Ohh, I think it just depends on whether you have StrongParameters or not.
[10:15:07] Andr3as: thanks a lot!
[10:15:07] tbuehlmann: since it's permitted, yeah
[10:15:41] mixnblend: has joined #RubyOnRails
[10:16:01] Andr3as: so, does it matter if to_h or to_unsafe_hash in my case?
[10:16:20] tbuehlmann: since your params are permitted, they do the same
[10:17:15] Andr3as: i am expecting like 3 messages a day.. so i think i do not need a background job framework, right?
[10:17:33] Andr3as: i looked into sidekiq but the overhead is way too much, imho.. (redis'n'such...)
[10:17:37] dminuoso: Andr3as: Kind of depends on what you want to do with it..
[10:18:03] Andr3as: its just a contact mailer.. if someone wants to send a message and not use email
[10:18:12] dminuoso: Andr3as: but if you just want to avoid redis, you can use delayed_job. But whether you need a job system depends on stuff.
[10:18:17] Andr3as: for a not really visited page
[10:18:52] conta: has joined #RubyOnRails
[10:18:55] tbuehlmann: you could also just use the async adapter, no further dependencies needed and it won't block the user
[10:18:58] Andr3as: isnt "deliver_later" exactly a "delayed job kind of thing"?
[10:19:22] tbuehlmann: it's activejob, and depending on what adapter you use different things will happen
[10:20:05] tbuehlmann: the async adapter is the default, iirc
[10:20:05] Andr3as: i havent configed anything.. so i am plain vanilla rails 5.1 - what does it do out of the box?
[10:23:17] dminuoso: Andr3as: Like I said, without knowing the exact requirements its hard to say. If you needed some "send in 2 hours" kind of messaging, async adapter wont be enough.
[10:23:43] dminuoso: Andr3as: So its best to understand what all those adapters do, and then pick the best for you system. Also a redis dependency is really minor.
[10:24:43] Andr3as: like i said, its a contact mailer if someone wants to send a message via the webpage instead of email
[10:24:57] Andr3as: so, a contact form
[10:25:04] Andr3as: nobody uses it anyway
[10:25:11] dminuoso: Andr3as: Does this necessarily require any jobs?
[10:25:16] Andr3as: i dont use contact forms
[10:25:23] dminuoso: Cant you just push the message synchronously into the system?
[10:25:40] Andr3as: it just sends an email.. and it would be good if it does that asynchronous.. should the mail server fail
[10:26:32] dminuoso: Andr3as: ActionMailer uses ActiveJob already.
[10:26:35] dminuoso: Andr3as: You just .deliver_later and that's it.
[10:27:07] dminuoso: For details: http://guides.rubyonrails.org/active_job_basics.html#action-mailer
[10:27:09] tbuehlmann: I can't follow, that's what Andr3as is doing?
[10:27:14] Andr3as: thats what i tried to say with:
[10:27:20] Andr3as: [05:18:57] <Andr3as> isnt "deliver_later" exactly a "delayed job kind of thing"?
[10:27:20] marr: has joined #RubyOnRails
[10:27:35] conta: has joined #RubyOnRails
[10:27:37] Andr3as: yeah, tbuehlmann.. he's on fire, eh? ;)
[10:27:43] dminuoso: Andr3as: Kind of.
[10:28:11] dminuoso: ACTION sighs
[10:33:52] b3rnd: has joined #RubyOnRails
[10:34:18] Andr3as: hmm.. it all works, but it doesnt deliver later but does it "now".. server log shos
[10:34:26] Andr3as: ...to Async(mailers) with arguments: "ContactMailer", "new_message", "deliver_now!",...
[10:34:40] Andr3as: even though i call it with: ContactMailer.new_message(contact_params.to_h).deliver_later!
[10:35:20] Andr3as: thats odd.. anything i could do wrong? i thought its straight forward..
[10:37:04] Andr3as: just saw thats normal..
[10:37:11] Andr3as: "...When you call #deliver_later method you put the job into the queue Active Job. Inside the queue it calls #deliver_now. deliver_later (ActionMailer::MessageDelivery)..."
[10:37:36] hahuang65: has joined #RubyOnRails
[10:39:25] Andr3as: and fun fact, if you do not specify a delay it still sends it asynchronous
[10:39:48] tjbp: has joined #RubyOnRails
[10:39:53] Andr3as: so i made it ContactMailer.new_message(contact_params.to_h).deliver_later(wait: 5.seconds) which does work flawlessly
[10:40:20] Andr3as: asynchronys was meant to by synchronous
[10:40:46] Jameser: has joined #RubyOnRails
[10:44:15] uks: has joined #RubyOnRails
[10:47:51] LateralO1: has joined #RubyOnRails
[10:51:53] cabotto: has joined #RubyOnRails
[11:03:34] doublemalt_: has joined #RubyOnRails
[11:03:41] za1b1tsu: Im using Cancancan anyway I can access authorize! from a service object?
[11:03:47] za1b1tsu: can I delegate the method somehow?
[11:07:09] AzaToth: has joined #RubyOnRails
[11:09:52] powrtoch: has joined #RubyOnRails
[11:13:11] apparition: has joined #RubyOnRails
[11:18:19] schneide_: has joined #RubyOnRails
[11:19:41] Polysics: has joined #RubyOnRails
[11:20:17] Polysics: so, if an application receives a POST with type application/json, should that get into params automatically?
[11:24:49] cabotto: polysics, I believe that is the case
[11:26:14] Polysics: the guide seems to imply that but I have a controller that does not
[11:27:40] Polysics: can it be turned off somehow? is it related to strong params? or should "logger.debug params.inspect" just show them?
[11:27:50] Polysics: I have never seen this behavior before :)
[11:32:19] alfiemax: has joined #RubyOnRails
[11:37:05] hahuang65: has joined #RubyOnRails
[11:38:26] roshanavand: has joined #RubyOnRails
[11:42:23] sonOfRa: has joined #RubyOnRails
[11:44:00] schneide_: has joined #RubyOnRails
[11:44:10] mikecmpbll: has joined #RubyOnRails
[11:47:17] SebastianThorn: has joined #RubyOnRails
[11:50:06] workmad3: has joined #RubyOnRails
[11:56:34] schneide_: has joined #RubyOnRails
[12:07:10] cabotto: polysics, Just looking in my code for an example.... I have JQuery '$.post(endpoint, {'name': newName})' and then access params[:name] in my controller create action
[12:08:29] Jameser: has joined #RubyOnRails
[12:13:02] _aiguuu_: has joined #RubyOnRails
[12:20:29] roshanavand: has joined #RubyOnRails
[12:21:26] Polysics: has joined #RubyOnRails
[12:23:12] schneide_: has joined #RubyOnRails
[12:30:46] gregf_: has joined #RubyOnRails
[12:36:03] jottr: has joined #RubyOnRails
[12:38:55] hahuang65: has joined #RubyOnRails
[12:40:29] brendan-: has joined #RubyOnRails
[12:48:26] LateralOctober: has joined #RubyOnRails
[12:51:33] apeiros_: has joined #RubyOnRails
[12:57:35] dminuoso: Need some ideas. Changes to my cell slim files are not being reloaded, while changes to my cell ruby files are.
[13:00:10] mixnblend: has joined #RubyOnRails
[13:04:16] za1b1tsu: So I need to make a controller, that acts like a 'homepage' (it can't be root) for example it's menu represents other controllers
[13:05:01] za1b1tsu: I never done this before, is there a term for this type of controller? Some best practices/nice tutorial? Can't find relevant information, maybe I can't name what I want
[13:06:04] dminuoso: za1b1tsu: a controller is not a term that makes sense in a website.
[13:06:45] za1b1tsu: I see, you told me 2 months ago that if it has a route, it's a controller
[13:07:06] za1b1tsu: helped me a lot btw, so there is a route to page, that has subpages
[13:07:16] cabotto: polysics, I just thought, it's only the top level json key thats available in params. The internal structure will then be hashes, arrays etc. Just in case that helps :)
[13:07:21] dminuoso: za1b1tsu: https://i.stack.imgur.com/lOJBS.png
[13:07:28] dminuoso: za1b1tsu: This might help you.
[13:08:16] dminuoso: za1b1tsu: 1) send HTML request: GET /users. It hits the router, the router shoves it into the `index` action of the appropriate controller, that then uses the model to generate some HTML. Then the controller returns that HTML.
[13:08:31] Polysics: cabotto: thank you, this is actually not parsing the entire thing :)
[13:09:19] za1b1tsu: dminuoso, ok, so the html is from multiple templates
[13:09:25] dminuoso: za1b1tsu: perhaps, or not.
[13:09:33] dminuoso: za1b1tsu: but it could be.
[13:09:46] dminuoso: za1b1tsu: I personally have a HomeController with just a single action "show"
[13:10:04] za1b1tsu: nice, and I made one with index
[13:10:10] dminuoso: za1b1tsu: Personally I think a lot in terms of resources.
[13:10:21] dminuoso: za1b1tsu: /home is a _resource_ that can be requested.
[13:10:35] dminuoso: And by "resource" I mean in a very abstract sense.
[13:10:56] za1b1tsu: but I can't think of the next step, do I just render inside the html, like I render partials?
[13:11:01] dminuoso: za1b1tsu: So in order to _provide_ said resource, you need a controller for it.
[13:11:04] dminuoso: controllers provide resources.
[13:11:13] dminuoso: or rather: they provide ways to interact with resoruces.
[13:11:46] dminuoso: And in a RESTful way those would appropriately respond to GET/POST/PATCH/PUT/DELETE
[13:19:34] mixnblend: has joined #RubyOnRails
[13:20:25] za1b1tsu: so I just use a layout and yeild in it
[13:21:42] damonf: has joined #RubyOnRails
[13:24:19] _ritchie_: has joined #RubyOnRails
[13:25:39] cabotto: has joined #RubyOnRails
[13:36:35] Sylario: has joined #RubyOnRails
[13:36:42] hahuang65: has joined #RubyOnRails
[13:43:27] ferox: has joined #RubyOnRails
[13:44:11] sonOfRa: has joined #RubyOnRails
[13:50:05] tcopeland: has joined #RubyOnRails
[13:51:00] workmad3: has joined #RubyOnRails
[13:56:10] greengriminal: has joined #RubyOnRails
[13:56:18] cschneid: has joined #RubyOnRails
[14:05:05] b3rnd: has joined #RubyOnRails
[14:06:34] cabotto: has joined #RubyOnRails
[14:06:36] alfiemax: has joined #RubyOnRails
[14:07:31] za1b1tsu: I can't get yield to work https://gist.github.com/bbtdev/e7172b56187ea7986d3ef98e6459c455
[14:07:46] za1b1tsu: when I click on the link replaces the whole page
[14:09:42] yonahw: has joined #RubyOnRails
[14:10:26] cabotto: has joined #RubyOnRails
[14:26:02] brendan-: has joined #RubyOnRails
[14:32:13] _aeris_: has joined #RubyOnRails
[14:36:49] za1b1tsu: can someone offer me a sugestion?
[14:36:52] za1b1tsu: I can't get yield to work https://gist.github.com/bbtdev/e7172b56187ea7986d3ef98e6459c455
[14:38:05] doublemalt_: has joined #RubyOnRails
[14:38:20] DrYockel1: has joined #RubyOnRails
[14:39:40] hahuang65: has joined #RubyOnRails
[14:45:34] za1b1tsu: has joined #RubyOnRails
[14:45:58] za1b1tsu: does content_for only work on partials?
[14:50:15] za1b1tsu: my only option to render a page inside a div on clicking a link is to use javascript?
[14:51:19] dminuoso: za1b1tsu: It depends. I frequently simply rerender the entire page, and rely on turbolinks doing the right thing™
[14:51:37] Saukk: has joined #RubyOnRails
[14:51:40] dminuoso: (It's a question of whether I need low response, or whether 100ms is acceptable)
[14:52:32] za1b1tsu: dminuoso, when I press a link, to do I render the linked page inside a div?
[14:52:35] cabotto: has joined #RubyOnRails
[14:52:37] za1b1tsu: is yield for this?
[14:53:34] za1b1tsu: or at least how do I keep my menu bar
[14:57:23] dminuoso: za1b1tsu: Menu bars are kind of trick in a lot of ways.
[14:57:54] dminuoso: za1b1tsu: I recommend you stick to something relatively static to begin with.
[15:01:39] za1b1tsu: yield works from the application.html.erb layout, but not from a layout I basically copy pasted from it
[15:01:54] za1b1tsu: is something special about application.html.erb?
[15:02:27] dminuoso: za1b1tsu: No.
[15:04:54] za1b1tsu: weird, alright, thank you
[15:05:05] krawchyk: has joined #RubyOnRails
[15:06:07] alfiemax: has joined #RubyOnRails
[15:13:21] moei: has joined #RubyOnRails
[15:13:45] mixnblend: has joined #RubyOnRails
[15:16:54] schneide_: has joined #RubyOnRails
[15:19:12] schneide_: has joined #RubyOnRails
[15:19:27] LateralOctober: has joined #RubyOnRails
[15:22:09] cabotto: has joined #RubyOnRails
[15:33:00] damonf: has joined #RubyOnRails
[15:33:33] hahuang65: has joined #RubyOnRails
[15:39:26] aguestuser: has joined #RubyOnRails
[15:43:37] aguestuser: has joined #RubyOnRails
[15:51:48] workmad3: has joined #RubyOnRails
[15:54:58] arBmind: has joined #RubyOnRails
[15:55:39] zave: has joined #RubyOnRails
[16:03:31] schneide_: has joined #RubyOnRails
[16:06:58] schneide_: has joined #RubyOnRails
[16:08:22] troys: has joined #RubyOnRails
[16:21:38] Olipro: has joined #RubyOnRails
[16:22:05] krawchyk: has joined #RubyOnRails
[16:23:47] workmad3: has joined #RubyOnRails
[16:24:08] damonf: has joined #RubyOnRails
[16:28:13] apeiros_: has joined #RubyOnRails
[16:28:46] alfiemax: has joined #RubyOnRails
[16:31:45] _aeris_: has joined #RubyOnRails
[16:37:32] hahuang65: has joined #RubyOnRails
[16:39:48] dionysus69: has joined #RubyOnRails
[16:43:02] uksio: has joined #RubyOnRails
[16:55:53] conta: has joined #RubyOnRails
[17:01:53] hfp_work: has joined #RubyOnRails
[17:12:32] DrYockel: has joined #RubyOnRails
[17:16:37] one_zero: has joined #RubyOnRails
[17:28:40] darkhanb: has joined #RubyOnRails
[17:30:42] ur5us: has joined #RubyOnRails
[17:34:14] hahuang65: has joined #RubyOnRails
[17:42:17] doublemalt_: has joined #RubyOnRails
[17:47:25] ewilliam: hi, i've been trying to figure out whats going on here with has_many relation calls not bringing up objects from the database. but it works with only objects added in memory https://gist.github.com/ewilliam/2b05291f02624af1fb82016897d07e74
[17:47:48] ewilliam: seems simple, i might be missing something
[17:50:39] ur5us: has joined #RubyOnRails
[17:51:57] hahuang65: has joined #RubyOnRails
[17:54:16] dviola: has joined #RubyOnRails
[18:00:19] Cache_Money: has joined #RubyOnRails
[18:01:16] dviola: has joined #RubyOnRails
[18:02:43] alfiemax: has joined #RubyOnRails
[18:18:09] srinidhi: has joined #RubyOnRails
[18:20:56] [Butch]: has joined #RubyOnRails
[18:24:25] chouhoulis: has joined #RubyOnRails
[18:26:19] ur5us: has joined #RubyOnRails
[18:27:20] KeyJoo: has joined #RubyOnRails
[18:28:40] Dbugger: has joined #RubyOnRails
[18:28:43] Dbugger: Hello everyone
[18:29:31] Dbugger: I have a small problem, when I make a POST request, it seems that my data is sent twice, and I have no idea what the reason could be. This is the output on the process running the server:
[18:29:35] Dbugger: Started POST "/auth" for 127.0.0.1 at 2018-02-07 19:27:53 +0100
[18:29:35] Dbugger: Processing by DeviseTokenAuth::RegistrationsController#create as HTML
[18:29:35] Dbugger: Parameters: {"email"=>"test@test.com", "password"=>"[FILTERED]", "registration"=>{"email"=>"test@test.com", "password"=>"[FILTERED]"}}
[18:30:15] Dbugger: As you see in the parameters, there is a "registration" item that holds the same parameters than in the root level
[18:30:24] Dbugger: and it does not happen only in this controller, but in the others as well
[18:30:59] zigzig: has joined #RubyOnRails
[18:31:42] mmoll: https://git.io/vN5iK - what's the Rails 5.2.x way of checking if a migration (from a plugin in that case, so it's not always applied) was applied? ActiveRecord::Migrator doesn't have get_all_versions anymore
[18:42:56] _ritchie_: has joined #RubyOnRails
[18:46:35] za1b1tsu: has joined #RubyOnRails
[18:49:11] lxsameer: has joined #RubyOnRails
[18:53:27] kies: has joined #RubyOnRails
[18:54:06] workmad3: has joined #RubyOnRails
[19:06:04] hfp_work: has joined #RubyOnRails
[19:15:07] mixnblend: has joined #RubyOnRails
[19:20:24] LateralOctober: has joined #RubyOnRails
[19:22:34] crankharder: Dbugger: It's probably the way you have your form set up. I'd check the generated markup of the page to see if there are some extra fields you didn't mean to include. You could also send a post with curl so have more control over the params being sent and see what happens that way
[19:37:46] schneide_: has joined #RubyOnRails
[19:41:21] srruby: has joined #RubyOnRails
[19:42:25] srruby: I'm creating a new Rails5 project and I want to use scaffolding and bootstrap to generate views. It has been a few years since I've reviewed scaffolding. Any advice ?
[19:43:26] glassresistor: has joined #RubyOnRails
[19:44:26] Inside: what advice do you need?
[19:44:51] srruby: Inside: Which gems do you suggest?
[19:45:17] Inside: bootstrap-sass and simple_form
[19:46:01] Inside: That'll get you to the generic bootstrap-enabled form look
[19:48:10] Dbugger: crankharder, there is no form. it is request made with httpie
[19:52:40] mtkd: has joined #RubyOnRails
[19:53:57] Dbugger: it is really weird... why is my Rails API app is giving me all parameters duplicated when I make a call???
[20:00:57] arBmind: has joined #RubyOnRails
[20:07:19] Dimik: has joined #RubyOnRails
[20:10:39] krawchyk: has joined #RubyOnRails
[20:10:48] Aherin: has joined #RubyOnRails
[20:20:34] srruby: It has been a while... What is being used by professional rails developers for integration and unit testing these days?
[20:22:52] fryguy: minitest or rspec have been the de facto standards for years now
[20:22:58] fryguy: rails comes with built-in support for minitest
[20:23:59] tcopeland: srruby: and capybara + headless chrome for integration tests
[20:24:21] srruby: tcopeland: Thanks!
[20:42:18] hive-mind: has joined #RubyOnRails
[21:03:41] brendan-: has joined #RubyOnRails
[21:05:38] gambl0re: has joined #RubyOnRails
[21:12:11] _ritchie_: has joined #RubyOnRails
[21:14:30] schneide_: has joined #RubyOnRails
[21:19:38] workmad3: has joined #RubyOnRails
[21:21:10] Inside: Can someone please yell at the person who developed this database for using nchar(50) in a million places?
[21:25:28] Radar: GOOD MORNING
[21:25:42] Radar: Inside: Sure, what's their email? I'm good at yelling at people on the internet (as evidenced by my first message this AM)
[21:26:04] Radar: Dbugger: Hi. Can you show me the duplicated parameters?
[21:26:22] Dbugger: Radar, sure, let me show you
[21:27:12] Dbugger: Radar, if I make this request on the shell: "http POST :3000/posts title=mytitle3" I get this on the process running the server:
[21:27:22] Dbugger: Started POST "/posts" for 127.0.0.1 at 2018-02-07 20:52:31 +0100
[21:27:22] Dbugger: Processing by PostsController#create as HTML
[21:27:22] Dbugger: Parameters: {"title"=>"mytitle3", "post"=>{"title"=>"mytitle3"}}
[21:27:34] Radar: ActionController::ParamsWrapper is probably the culprit.
[21:28:14] Radar: config/initializers/wrap_parameters.rb <- you'll find the configuration for it here.
[21:28:35] Dbugger: let me take a look
[21:28:53] Dbugger: There is an option there, that says " wrap_parameters format: [:json]"
[21:29:03] Radar: mmmmmhmmmmm
[21:29:07] Radar: Dbugger: It's done so that you can pass unwrapped parameters to a JSON action and Rails will make them all available under params[<singular controller name]
[21:29:26] Radar: So it's _probably_ not doing you any harm, but you can disable it by following the directives in that file if you really want.
[21:30:27] Radar: crankharder: ^ FYI
[21:30:51] Dbugger: Radar, so you mean that I should just ignore it?
[21:30:57] Radar: If you'd like.
[21:32:39] Dbugger: oh well, if it is not damaging me in any way... even though it is quite funny to see :P
[21:32:49] Dbugger: I was just scared I messed up something
[21:33:25] Dbugger: besides now I have to know that if I call "/posts" then, in the parameters I send there cant be any "poll: ..."
[21:34:27] Radar: I think it's one of those Rails features that 37s thought would be a good addition but is actually more confusing than helpful.
[21:34:45] Radar: something something MAGIC
[21:35:56] Dbugger: what is "37s"?
[21:37:05] zave: has joined #RubyOnRails
[21:37:18] Radar: 37Signals.
[21:37:41] Radar: I guess they're now called Basecamp, aren't they? They're the company that started Rails.
[21:38:01] weathermaker: has joined #RubyOnRails
[21:39:18] Dbugger: oh really? I never knew
[21:39:45] Dbugger: oh well, it definitely makes it more confusing, specially since it only happens with the API version of Rails and not with the normal one
[21:39:49] Dbugger: but oh well
[21:47:32] starseed00: has joined #RubyOnRails
[21:48:10] starseed00: I would like to send out an email after a user signs up, but I don't really feel like it's the responsibility of the User model, what is the best way to do this? I am thinking just sending it in the controller.
[21:57:29] mtkd: has joined #RubyOnRails
[22:07:53] deramius: has joined #RubyOnRails
[22:09:16] deramius: can someone please explain why (in rails 4.2.5) i am required to declare that a .css or .js file is to be precompiled when I have already added a sprockets directive to precompile this file? Why do I have to add the Rails.assets.config.precompile statement in an initializer in order to have the file precompiled?
[22:09:49] fryguy: you shouldn't have to do this
[22:09:55] fryguy: can you elaborate a little bit more about what you are trying to do?
[22:10:15] fryguy: i have a suspicion about what's going on in your case, but wanna hear it and verify first
[22:12:02] deramius: fryguy, just one moment
[22:13:51] deramius: This is the error that I receive in the logs when I attempt to load the `my_model#new` action. https://bpaste.net/show/9bdbec798ead
[22:14:18] fryguy: and where is the sprockets compilation of this happening
[22:16:07] deramius: my `application.js` file is here. you'll notice that `my_model` isn't explicitely specified, but (i am assuming) caught by the directive on line 12. https://bpaste.net/show/7942275b1dd1
[22:16:34] fryguy: ok, and why are you trying to javascript_include_tag 'my_model' instead of application?
[22:16:45] deramius: i don't have a good answer for that
[22:16:57] fryguy: try that first
[22:17:02] deramius: ACTION nods
[22:17:10] fryguy: as for what's actually happening to you:
[22:17:20] fryguy: you are getting my_model compiled into application.js, like you expect
[22:17:35] fryguy: and then when rails goes to actually compile assets, it compiles application.js
[22:18:09] fryguy: when you go to include a javascript file that ISN'T application.js, it looks in the list of files it precompiiles, and it's not in that list, the only thing in the list (with exceptions not noteworthy here), is application.js
[22:18:31] fryguy: adding it to sprockets makes it go into the file you specify it to go into (application.js), it doesn't make a new precompiled file for you
[22:19:55] deramius: fryguy, that makes perfect sense. thanks for the explanation.
[22:20:44] deramius: i am thinking that the reason that `my_model is being included specifically may be to prevent issues with doubly including the `application.js` file. That is just a theory. I am going to try swapping it out now.
[22:20:52] deramius: `my_model`*
[22:21:01] workmad3: has joined #RubyOnRails
[22:22:33] gambl0re: has joined #RubyOnRails
[22:26:53] deramius: fryguy, perfect, no problems. thank you so much!
[22:41:56] chouhoulis: has joined #RubyOnRails
[22:45:02] npgm: has joined #RubyOnRails
[22:45:42] FrostCandy: has joined #RubyOnRails
[23:03:51] jottr: has joined #RubyOnRails
[23:11:06] hahuang61: has joined #RubyOnRails
[23:20:23] LateralOctober: has joined #RubyOnRails
[23:21:27] orbyt_: has joined #RubyOnRails
[23:38:31] tcopeland: has joined #RubyOnRails
[23:44:47] andywww: has joined #RubyOnRails