Martin Petrov
Martin Petrov

Reputation: 2643

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?

Upvotes: 2

Views: 3442

Answers (2)

user460502
user460502

Reputation: 31

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

Upvotes: 3

Nerian
Nerian

Reputation: 16197

You may use a hidden field.

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

Put that code in the new view.

Upvotes: 7

Related Questions