Hello, there:
I wish A link to invoke such a action together with the parameter
"zh_CN" "cookies/switch_language/zh_CH" to switch language
sellection, and I use the following code:
<%= link_to 'Chinese', :controller => 'cookies', :action =>
'switch_lang' %>
But, how is "link_to" able to convey the params: zh_CN as well?
seems like link_to doesn't support a option :params =>
'zh_CN'.....because it errors when I use
'<%= link_to 'Chinese', :controller => 'cookies', :action =>
'switch_lang/zh_CN' %> &
<%= link_to 'Chinese', :controller => 'cookies', :action =>
'switch_lang', params: => 'zh_CN ' %>
Hello, there:
I wish A link to invoke such a action together with the parameter
"zh_CN" "cookies/switch_language/zh_CH" to switch language
sellection, and I use the following code:
<%= link_to 'Chinese', :controller => 'cookies', :action =>
'switch_lang' %>
But, how is "link_to" able to convey the params: zh_CN as well?
seems like link_to doesn't support a option :params =>
'zh_CN'.....because it errors when I use
'<%= link_to 'Chinese', :controller => 'cookies', :action =>
'switch_lang/zh_CN' %> &
<%= link_to 'Chinese', :controller => 'cookies', :action =>
'switch_lang', params: => 'zh_CN ' %>
Assuming you still have the default route installed use this: