#RubyOnRails - 18 April 2019
« Back 1 day Forward 1 day »
[00:06:30] jarr0dsz: i would like to ask some advice regarding hosting a rails application under a domain.ltd/customlocation
[00:07:12] jarr0dsz: is there some official documentation on how i would handle this? i need also to have forms and posts from external api all work true this so i hoped i could globally prepend a 'mylocation' to everything that is genrated in rails ( form routes, routes, etc )
[00:16:03] jarr0dsz: so i found this writeup: https://gist.github.com/shad1w/75e7ebbbdc5382719cd06f56bbe6acd0 but form posts do not prepend this custom url route
[00:25:43] jarr0dsz: so setting RAILS_RELATIVE_URL_ROOT does not fix the forms. it would be nasty to manually having to prepend al routings
[00:29:52] jarr0dsz: so its 2019 and i cannot find a documented way for this, guess nobody wants to run rails in a subfolder
[00:38:21] jarr0dsz: anyone knows something better than having to do this: :url => "/" + ENV['RAILS_RELATIVE_URL_ROOT'] + vs_wizard_path do |f| in my whole app?
[15:08:16] Eindoofus: can anyone someone please explain how i'm able to use 'user_params' in the top example but in the bottom class 'params[:email]' is used? i would have at least expected 'user_params[:email]' in the second example, but that still doesn't make sense. how does it knows about 'user_'?
[18:25:13] jefffrails35: eindoofus, user_params is usually a private function defined in the controller, it is used to whitelist request params. user_params should return an ActionController::Parameters class, you can view it as a hash.
[18:25:40] jefffrails35: eindoofus, https://api.rubyonrails.org/classes/ActionController/Parameters.html
[18:27:12] jefffrails35: jarr0dsz, it seems to be described here: https://guides.rubyonrails.org/asset_pipeline.html#turning-digests-off