Re: [Rails] Form_for text_area

42 views
Skip to first unread message

Dheeraj Kumar

unread,
Mar 13, 2013, 3:33:56 AM3/13/13
to rubyonra...@googlegroups.com
For the default value, add it in the model. Maybe in an after_initialize callback.
For the row and col values, read the documentation. http://api.rubyonrails.org/?q=text_area

-- 
Dheeraj Kumar

On Wednesday 13 March 2013 at 11:28 AM, karthik Satyanarayana wrote:

Hi all, Since I am new to ruby on rails. I'm stuck in some minor issue. 
I am using form_for in my view. 

In that I am using a text text. So, My question is, how to add a default value to the text_area along with the row and col values.

Please help me out ASAP.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/yCfnQOpbX5gJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Crispin Schäffler

unread,
Mar 13, 2013, 5:35:16 AM3/13/13
to rubyonra...@googlegroups.com
Hey

If you want default values add them in your model. If you are talking about a placeholder in your view:

form_for() do |f|

f.text_area :name, :rows => 5, :placeholder => "Your Text here...."


AS you can see i set 5 rows for the text area AS default to display. And there is some placeholder text in it...

Hope this helps you.

Reply all
Reply to author
Forward
0 new messages