text_area tag in Rails – Issues


When you start New Rails project.  Always we used scaffolding for creating simple base for out application.

I used scaffolding for some methods. I got some very weird issue about tex_area tag in rails.

When i check the forms textagea fields are coming with 20 rows and 40 cols default. When i tried to change that is not changing even though CSS also.

<textarea id=”dummy_text” rows=”20″ name=”dummy_text” cols=”40″/>

After digging into rails code i got know that Rails ->Actionpack-> form_helper.rb file has default setting of textarea field.

def text_area(object_name, method, options = {})
InstanceTag.new(object_name, method, self, options.delete(:object)).to_text_area_tag(options)
end

We can change this also. but this is not good idea

so good idea is select our project and use find replace:

text_area to text_area_tag

This is the simplest solution.


Advertisements
This entry was posted in Open source, Ruby on Rails and tagged , , , , , by Purab Kharat. Bookmark the permalink.

About Purab Kharat

I am WordPress and Drupal Architect. I worked on many technologies like Ruby on Rails, Flex, PHP etc... I am Purab Kharat from India, Pune. I love to play chess and listen music and read books. I work in SY Smartsourcing Global Pvt Ltd in Princeton, NJ, USA. Now I am living at Plainsboro, 164 Hampshire Drive, Princeton Meadows, NJ. I have more then Ten years experience in Web Application Development (Specially in Php 5.0, Ruby on Rails, Mysql 5.0, RIA, Wordpress, Drupal, Joomla, Ecommerce)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s