How do I set an id attribute like id="datepicker" in an input text_field using a form helper. I tried this:- <%= f.text_field :paid_date, :id="datepicker" %> but it produces an error. Note that I want <input type="text" name="paid_date" id="datepicker"> as the result, not <input type="text" name="datepicker[paid_date]"> which is all I can find in the API. -- Posted via http://www.ruby-forum.com/. -- 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 at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 15 July 2010 07:28, Mark Horrocks <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> How do I set an id attribute like id="datepicker" in an input text_field > using a form helper. > > I tried this:- > <%= f.text_field :paid_date, :id="datepicker" %> > but it produces an error. > > Note that I want <input type="text" name="paid_date" id="datepicker"> as > the result, not <input type="text" name="datepicker[paid_date]"> which > is all I can find in the API.Can you not just manage with the default id which should be <model_name>_paid_date I think? Colin -- 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 at http://groups.google.com/group/rubyonrails-talk?hl=en.
> Can you not just manage with the default id which should be > <model_name>_paid_date I think? > > ColinThe jQuery datepicker calendar wants id="datepicker" on the input field. -- Posted via http://www.ruby-forum.com/. -- 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 at http://groups.google.com/group/rubyonrails-talk?hl=en.
Mark Horrocks wrote:> >> Can you not just manage with the default id which should be >> <model_name>_paid_date I think? >> >> Colin > > The jQuery datepicker calendar wants id="datepicker" on the input field.I found the error, I had omitted a closing ">" on the preceding td element. Now I just have to deal with the calendar wanting to wrap the arrows for month selection :( -- Posted via http://www.ruby-forum.com/. -- 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 at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Jul-15 13:45 UTC
Re: Form Helper Text_field with datepicker calendar
Mark Horrocks wrote:> Mark Horrocks wrote: >> >>> Can you not just manage with the default id which should be >>> <model_name>_paid_date I think? >>> >>> Colin >> >> The jQuery datepicker calendar wants id="datepicker" on the input field. > > I found the error, I had omitted a closing ">" on the preceding td > element.I strongly suggest using HAML, not ERb, for your views. Besides lots of other advantages, you''ll never leave off a > again! Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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 at http://groups.google.com/group/rubyonrails-talk?hl=en.