Mohammed Alenazi
2010-May-21 15:56 UTC
set a title attribute for the text field inside rails form
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 <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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-May-21 17:12 UTC
Re: set a title attribute for the text field inside rails form
On May 21, 4:56 pm, Mohammed Alenazi <vb4...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 HTMLWhat 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Mohammed Alenazi
2010-May-21 22:28 UTC
Re: set a title attribute for the text field inside rails form
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 <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On May 21, 4:56 pm, Mohammed Alenazi <vb4...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Philip Hallstrom
2010-May-21 22:43 UTC
Re: Re: set a title attribute for the text field inside rails form
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 <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> On May 21, 4:56 pm, Mohammed Alenazi <vb4...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.