我试图将用户选择保存在 cookie 中,但我认为我做错了什么。
这是我认为的链接
<%= link_to image_tag("venezuela.png", :height => '74', :width => '111'), {:controller => "landing", :action => "select_country", :country => "venezuela"}, :method => "get" %>
这是我的控制器的动作
def select_country
cookies.permanent[:country] = params[:country]
case params[:country]
when "venezuela"
redirect_to "google.co.ve"
end
end
当我单击链接时,会出现此错误:
Unknown action
The action 'show' could not be found for LandingController
并转到此网址
http://localhost:3000/landing/select_country?country=venezuela
在此先感谢您的帮助。