You've got something mucking with your output.  Maybe a plugin or a form 
builder?  On a clean Rails 2.3.5 app with the following view....

<% @foo = Foo.new %>
<% form_for @foo do |f| %>
  <%= f.text_field :name, :title => 'my title' %>
<% end %>

... gives me this...

  <input id="foo_name" name="foo[name]" size="30" title="my title" type="text" 
/>

-philip


On May 21, 2010, at 3:28 PM, Mohammed Alenazi wrote:

> it ignores the :title for some reason
> <input type="text" size="30" name="user[email]"
> id="user_email" class="autoclear">
> 
> On May 21, 8:12 pm, Frederick Cheung <[email protected]>
> wrote:
>> On May 21, 4:56 pm, Mohammed Alenazi <[email protected]> wrote:
>> 
>>> Hi
>>> I am trying to set title attribute for the text filed inside a form
>>> using rails.
>>> I tried
>>> <%= f.text_field :email  , :class => "autoclear",:title => "title" %></
>>> p>
>>> but it did not work
>>> I want it to produce this HTML
>> 
>> What did it produce ?
>> 
>> Fred
>> 
>>> <input type="text" title="title" size="30" name="user[email]"
>>> id="user_email" class="autoclear">
>> 
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Ruby on Rails: Talk" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to 
>>> [email protected].
>>> For more options, visit this group 
>>> athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to 
>> [email protected].
>> For more options, visit this group 
>> athttp://groups.google.com/group/rubyonrails-talk?hl=en.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to