Rails: Pass parameters with render :action?

前端 未结 4 1602
时光取名叫无心
时光取名叫无心 2020-12-08 07:14

I have a form that displays differently depending on the parameter it was called with.

Ex.

testsite.local/users/new?type=client

So

4条回答
  •  孤街浪徒
    2020-12-08 07:59

    As elucidated by another user answering my other related question, here's what I was after:

    form_for @user, :url => { :action => :create, :type => @type }
    

    ... which preserves the parameter :type through each new render action (assuming I have it defined correctly in my controller).

提交回复
热议问题