I’ve got a js.erb file in a rails 3.2 application that uses a url helper to fill in the url field on a jquery $.ajax call. It works fine when I use the path_to_method_url/path on my local machine correctly pointing to localhost:3000/path_to_method. When I put it in our staging environment that has a sub uri it points to example-staging.com/path_to_method instead of example-staging.com/sub-uri/path_to_method. Anyone know how to get the url helpers in assets to respect the sub-uri?
Share
Try override the
default_url_optionsin your application_controller.rbhttp://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-url_options
http://rails.rubyonrails.org/classes/ActionController/Base.html#M000467