开发者

No route matches {:controller=>"results", :action=>"show"}

开发者 https://www.devze.com 2023-03-29 06:07 出处:网络
Im upgrading a rails 2 app to rails 3 app and am having a bunch of routing issues. Heres the current:

Im upgrading a rails 2 app to rails 3 app and am having a bunch of routing issues. Heres the current:

So in the page its trying to load (results/_form.html.erb) I have a form with the following syntax:

<%= form_tag(:controller => "results",:action => "show") do %>

And i do hav开发者_Go百科e an action in my results_controller.rb called show. Yet i keep getting the no route matches error. Is this rails 2 syntax and not 3? Is there something I need to do in my routes.rb file? I think there is because that was a a major change between rails 2 and 3, im just not sure what. Any suggestions?


show action ideally should expect id to be passed in the params:

<%= form_tag(:controller => "results",:action => "show", :id => @user.id) do %>
0

精彩评论

暂无评论...
验证码 换一张
取 消