Harry
Harry

Reputation: 19

How to submit a form with some hidden information in Ruby on rails?

I created a method post add from controller and passed two parameters (two IDs) by a link to a form in which the user can fill other information. I want the 'Submit' button to create an object which would take two IDs as its attributes.

How can I do this?

Upvotes: 0

Views: 50

Answers (1)

Asnad Atta
Asnad Atta

Reputation: 4003

You can use hiddent_field tag for this

<%= f.hidden_field :id_1, value: "ID" %>

Upvotes: 3

Related Questions