开发者

How to pass parameters between New and Create actions?

开发者 https://www.devze.com 2023-02-03 13:13 出处:网络
I have a parameter in my url when linking to the Ne开发者_StackOverflow社区w action. I need this parameter in the create action. How do you do it?You may use a hidden field.

I have a parameter in my url when linking to the Ne开发者_StackOverflow社区w action. I need this parameter in the create action. How do you do it?


You may use a hidden field.

<input id="thing" type="hidden" value="<%= params[:thing] %>" />

Put that code in the new view.


I've found that <input type="hidden" name="modal" value="true" /> also works.

0

精彩评论

暂无评论...
验证码 换一张
取 消