【发布时间】:2016-01-04 21:42:55
【问题描述】:
我的 Rails 应用中有一个 link_to 方法:
link_to t('edit'), edit_building_path(@building, :hidden_action => params[:action])
如何从 url 中删除 hidden_action?
当前网址如下:
http://localhost:3000/buildings/2/edit?hidden_action=new
我的问题是我需要知道用户从哪个页面访问这个链接。
【问题讨论】:
-
这个问题我不清楚。如果您不想在 URL 中添加
hidden_action参数,请不要将其作为参数附加到方法调用中。 -
我需要一个 hidden_action 参数以便下次在控制器中使用
-
然后通过会话传递。
标签: ruby-on-rails url parameter-passing link-to