#RubyOnRails - 06 September 2019
« Back 1 day Forward 1 day »
[11:20:21] Cork: i would like to test if asset:precompile needs to run, anyone know if there are a good way to test that?
[11:42:07] xco: hi. i have a model. A and B. A belongs to B. in the form creation for A, how do i pass the b_id to the form using a dropdown?
[11:49:59] xco: <%= select_tag 'b_id', options_from_collection_for_select(@lot_of_bs, 'id', 'name') %>
[11:59:46] xco: <%= select_tag 'b_id', options_from_collection_for_select(@lot_of_bs, 'id', 'name') %>
[12:00:58] Cork: xco: well, "B must exist" is a model validator so you have to make sure you permit :b_id in the controller
[12:07:25] xco: I believe you mean using this select https://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/select
[13:21:14] galancito: Hi, has someone tried to use Rails.application.credentials and placing this on datababase.yml? I have done this and my application just crash. Any idea?
[13:23:41] galancito: "/usr/local/bundle/gems/mysql2-0.4.9/lib/mysql2/client.rb:89:in `connect': Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Mysql2::Error)"
[16:09:08] MrCrackPot: hey i have two facebook apps one for one country and another for another. they use omniauth sign in. due to the application using two facebook accounts im thinking to have two callbacks 1_facebook and 2_facebook the problem i can see is devise uses config.omniauth :facebook, 'APP_ID', 'APP_SECRET' ++. can i also change this to facebook_1 and facebook_2
[16:22:37] MrCrackPot: https://github.com/plataformatec/devise/blob/master/lib/devise/omniauth/config.rb
[16:23:57] MrCrackPot: i think that is the code used to i think changing the provider in config.omniauth to :1_facebook should work as long as i also pass that to the callback but im thinking im going to need a reroute either in the action and not in the caller so have a paramater in the user link to the action
[17:04:00] nate-^: I have a question about factorybot/factorygirl.. if I have a whole set of associations going on that go user->order_items->video_license->video should I be defining them in individual factories/[model].rb or should I be doing this in one single factory? it seems like significant britleness if I do this across multiple files
[18:00:26] MrCrackPot: nate-^, you could do in one or individual depends how many other models use it
[18:08:34] MrCrackPot: it should auto create your factories when you make a model which would create individual factories but you dont need to use them
[19:37:13] givemeaname: hello, today i got this error uninitialized constant ActionDispatch::Routing::RouteSet::Mapper (NameError)Did you mean? ActionDispatch::Routing::Mapper