NullVoxPopuli
NullVoxPopuli

Reputation: 65103

Ruby on Rails: How do I pass a variable along with f.submit?

Ruby on Rails: How do I pass a variable along with f.submit?

Upvotes: 0

Views: 270

Answers (2)

jefflunt
jefflunt

Reputation: 33954

The parameters you'rer passing would be the data in the form, yes?

What parameter/data are you trying to receive? If you want to know the name of the user who performed the submit, or the current time, or something similar, there are other ways to do it.

As Salil mentioned, the parameters/form data are accessible in the controller via the "params" array.

Upvotes: 0

Salil
Salil

Reputation: 47472

no you can't pass along with submit button.

but you get name of button as params[:commit] in controller

Upvotes: 2

Related Questions