是否可以使用此类型的redirect_to传递url参数?
redirect_to contact_path(@contact), :show_family => 'yes'
Run Code Online (Sandbox Code Playgroud)
我想要一个导致以下结果的网址:
/contacts/1?show_family=yes
Run Code Online (Sandbox Code Playgroud)
Ale*_*ner 14
是的,只需将查询字符串参数传递给contact_path:
redirect_to contact_path(@contact, :show_family => 'yes')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4096 次 |
| 最近记录: |