TextArea Parameter

17 views
Skip to first unread message

Jan Yo

unread,
Apr 7, 2014, 11:59:48 AM4/7/14
to rubyonra...@googlegroups.com
Given the following code:

form_tag ....
text_area :val, params[:val]
submit_tag...
end


Is there a way to change to

text_area :xx

but keep :val as the parameter that is passed to the backend? That is,
I want to change the id but the parameter name.

--
Posted via http://www.ruby-forum.com/.

Robert Walker

unread,
Apr 7, 2014, 1:21:00 PM4/7/14
to rubyonra...@googlegroups.com

Robert Walker

unread,
Apr 7, 2014, 1:30:13 PM4/7/14
to rubyonra...@googlegroups.com
Robert Walker wrote in post #1142180:
In case you didn't get that here's an example:

<%= f.text_area :description, { id: "my_description" } %>
=> <textarea id="my_description" name="person[description]"></textarea>

If you wan't to override any of the defaults you can pass what you want
in the "options" hash.
Reply all
Reply to author
Forward
0 new messages