Generating the input id with an ActiveRecord model
Posted
by swilliams
on Stack Overflow
See other posts from Stack Overflow
or by swilliams
Published on 2010-06-10T19:51:23Z
Indexed on
2010/06/10
19:52 UTC
Read the original article
Hit count: 139
ruby-on-rails
|activerecord
How do you generate an input's id
attribute, given a model? For example, if I have a model of Person
with a first_name
attribute, the form helper prints out a textbox with this html:
<input type="text" id="person_first_name" />
How can I generate that person_first_name
from some other place in the code (like in a controller or some place)?
© Stack Overflow or respective owner