#RubyOnRails - 16 September 2017
« Back 1 day Forward 1 day »
[02:50:34] tomoyuki28jp: Anyone is using rails_best_practices with guard? This gem is no longer maintained: https://github.com/logankoester/guard-rails_best_practices
[06:34:29] fighella: anyone had it where ajax.post sends params to a controller… but when raise params.to_s in controller - the expected params nowhere to be found?
[15:03:49] mustmodify: Interesting... in the last 60 days, someone has decided my Rails app must have a /wp-login.php endpoint. http://ft.trillian.im/85353d38f4d2f94dfd75830e8d48517cc62ddc94/6TwtFJRek2gHteAuylVE5CZ3DCv2e.jpg
[17:10:39] frexuz: I have a weird case with Devise's current_user. I'm trying to set it manually, like @current_user = ..., in my case it results in `nil`, however `current_user` is still a valid user. I don't understand how!
[17:10:42] frexuz: https://gist.github.com/Frexuz/40dfe020676f7df3db36733c30848e67#file-application_controller-rb-L13
[17:20:10] havenwood: frexuz: Devise #current_user method doesn't make any use of a @current_user instance variable as far as I can tell.
[17:20:29] havenwood: frexuz: You can override the method in your controller and call super if you want.
[17:21:42] funkytwig: Hi, i was trying to use 'rake assets:precompile' but yarn was missing. I use rbenv so could install webpack, or does that just make things more complex (still need yarn)
[17:21:45] havenwood: frexuz: def current_user; return unless auth_token && User.find(auth_token[:user_id]); super end
[17:22:13] havenwood: frexuz: Though the #find bit doesn't make much sense, as it'll error if there's not that id.
[17:34:48] francuz: hi I have a rails app with some routes, and I'd like to add "admin" inline modification capability on the routes "domainname.com/admin/any/normal/route/i/want". I made most of the work already, but I'd need the rooting part(for now, I comment and uncomment a "before_action :set_editor").
[17:34:48] francuz: I'd like that when the admin goes to "domainname.com/admin/any/normal/route/i/want", it send him to the same action than "domainname.com/any/normal/route/i/want", but with a before_action function in addition to usual
[17:36:12] francuz: the other possibility would be for me to add the before_action always, with a param check at the begining, and he'd acces it through "domainname.com/any/normal/route/i/want?editor=true" for example, but I'm not crazy about the idea ...
[18:09:15] frexuz: havenwood, i tried def current_user .... but now i'm never signed_in when using `before_action :authenticate_user!`
[18:28:49] funkytwig: havenwood, I don't have root access. Its debian. I will ask tham to add it. cmdtest seems to have yarn, will this do?
[20:14:44] dachinat: hello. I'm submitting a form_tag form with GET > search?utf8=✓&query=test\. My problem is that I'm getting a double backslash in params[:query]. Do you know how to solve this?
[21:42:36] mcr: are you sure you are really getting a double backslash? In a "" string, a single \ will be shown as \\, because otherwise, it's an escape.