Rails: Pass parameters with render :action?

前端 未结 4 1597
时光取名叫无心
时光取名叫无心 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:54

    You could always force it by:

    params[:type] ||= "client"
    

    in your new action in your controller. If type is not set then it will default to client. The URL will not show this however.

提交回复
热议问题