Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 如何在Rails 4中设置链接到辅助对象的默认主机?_Ruby_Ruby On Rails 4_Helper - Fatal编程技术网

Ruby 如何在Rails 4中设置链接到辅助对象的默认主机?

Ruby 如何在Rails 4中设置链接到辅助对象的默认主机?,ruby,ruby-on-rails-4,helper,Ruby,Ruby On Rails 4,Helper,目前我正在使用老式的方式将链接到 <%= link_to 'Attend Survey', {:controller => :survey, :action => :get_personal_data}, :class => 'btn btn-primary' %> 这确实应该行得通。可能是路径中的~符号混淆了Rails吗?也许吧,但不幸的是,我目前没有办法跳过它。你能做rake routes并发布输出吗?Rails似乎仍然存在问题-> Pref

目前我正在使用老式的方式将
链接到

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

这确实应该行得通。可能是路径中的
~
符号混淆了Rails吗?也许吧,但不幸的是,我目前没有办法跳过它。你能做
rake routes
并发布输出吗?Rails似乎仍然存在问题->
         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