1

Currently I am using the old fashioned way to make link_to

<%= link_to 'Attend Survey', {:controller => :survey, :action => :get_personal_data}, :class => 'btn btn-primary' %>

And the issue is that I have non default host (lets say it is something like /~foo/bar) for whole application.

I have added config.relative_url_root = '/~foo/bar' to the production.rb and all assets are shown correctly the only thing left is link_to helper which gives me still default host / route.

I may be doing something wrong but all solutions from this answer didn't work in that particular case or due to Rails 4 changes.

EDIT Due to production env RAILS_ENV=production rake routes gives me

         Prefix Verb URI Pattern                      Controller#Action
  survey_context GET  /survey/context(.:format)        survey#get_personal_data
                 GET  /survey/selfesteem/:id(.:format) survey#get_self_esteem
    survey_index GET  /survey/index(.:format)          survey#index
survey_thank_you GET  /survey/thank_you(.:format)      survey#thank_you
                 POST /survey/context(.:format)        survey#create_person
                 POST /survey/selfesteem/:id(.:format) survey#create_self_esteem_for_person
            root GET  /                                survey#index
Community
  • 1
  • 1
necromos
  • 442
  • 2
  • 12

0 Answers0