标签: ruby-on-rails
是否可以使用此类型的redirect_to传递url参数?
redirect_to contact_path(@contact), :show_family => 'yes'
我想要一个导致以下内容的网址:
/contacts/1?show_family=yes
答案 0 :(得分:14)
是的,只需将查询字符串参数传递给contact_path:
contact_path
redirect_to contact_path(@contact, :show_family => 'yes')