I trying to save the user seleccion in a cookie but I think I’m doing something wrong.
This is link in my view
<%= link_to image_tag("venezuela.png", :height => '74', :width => '111'), {:controller => "landing", :action => "select_country", :country => "venezuela"}, :method => "get" %>
Here is the action of my controller
def select_country
cookies.permanent[:country] = params[:country]
case params[:country]
when "venezuela"
redirect_to "google.co.ve"
end
end
When I make click in the link a get this error:
Unknown action
The action 'show' could not be found for LandingController
and goes to this url
http://localhost:3000/landing/select_country?country=venezuela
Thanks in advance for your help.
Looks like you have a routing problem. Make sure you don’t have a route that assumes all links going to
/landing/:anythingare for theshowaction ahead of the route that definesselect_countryas an action on that controller.