Pages

Tuesday, December 6, 2011

Ruby on Rails -=- Formatting Rails text_field_tag

Hi!

If you want to format a Rails text_field tag, simply do the following:

   <%= f.text_field :my_var, :value=> my_function(f.object.my_var) %> 

Where my_var is my variable and where my_function is a function where I can apply a format. You can apply directly the format that you want in :value instead of using a function

No comments:

Post a Comment