这非常有效:
- form_for @user, :url => { :action => :create, :type => @type } do |f| ...
Run Code Online (Sandbox Code Playgroud)
返回 /users/(id)?type=type
但在另一个视图中,我需要将两个参数传递给URL字符串,这不起作用:
- form_for @user, :url => { :action => :update, :type => @type, :this => @currently_editing } do |f| ...
Run Code Online (Sandbox Code Playgroud)
返回 /users/(id)?this=currently_editing
我也尝试过:
- form_for @user, :url => { :action => :update, :params = params.merge({:this => @currently_editing, :type = @type})} do |f| ...
Run Code Online (Sandbox Code Playgroud)
......没有运气(错误:只允许GET请求).
我想要的是它返回这个: /users/(id)?this=currently_editing&type=type
思考?