简体   繁体   中英

How to pass parameters between New and Create actions?

I have a parameter in my url when linking to the New 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.

我发现<input type="hidden" name="modal" value="true" />也有效。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM