Hi all. This question has been asked before but has not been answered, so I''ll try once again: Adding :class => "some_css_class" to the form.date_select or form.datetime_select helpers doesn''t do anything; the resulting HTML has no class= attribute in the <select> tag. Is this a bug in date_helper.rb or am I doing something wrong? Thanks! /fb -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Adam Block wrote:> Adding :class => "some_css_class" to the form.date_select or > form.datetime_select helpers doesn''t do anything; the resulting HTML has > no class= attribute in the <select> tag. Is this a bug in date_helper.rb > or am I doing something wrong?When an HTML tag doesn''t work I always try :html => { :some => ''tag'' }. As far as I can tell most tag builders support that. -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Phlip wrote:> When an HTML tag doesn''t work I always try :html => { :some => ''tag'' }.Thanks for the suggestion. Didn''t work, unfortunately. The date selectors wrap multiple HTML elements, but it looks like any class/html attributes are not cascading downwards to the individual tag builders. /afb -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ezra Zygmuntowicz
2006-Dec-10 23:10 UTC
Re: No CSS styles for date_select, datetime_select
On Dec 10, 2006, at 1:07 PM, Adam Block wrote:> > Phlip wrote: >> When an HTML tag doesn''t work I always try :html => { :some => >> ''tag'' }. > > Thanks for the suggestion. Didn''t work, unfortunately. > > The date selectors wrap multiple HTML elements, but it looks like any > class/html attributes are not cascading downwards to the individual > tag > builders. > > /afbHey Adam- Yeah the date selectors don''t allow you to pass html options, lame. The way I have worked around this was to use a little js: <script> $$(''select'').each(function(el) { if(el.className == ""){ el.addClassName("date-required"); } }); </script> Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez-NLltGlunAUd/unjJdyJNww@public.gmane.org -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You can use <span class="something"> <%= date_select %> </span> css .something select { your styles here } Adam Block wrote:> Phlip wrote: >> When an HTML tag doesn''t work I always try :html => { :some => ''tag'' }. > > Thanks for the suggestion. Didn''t work, unfortunately. > > The date selectors wrap multiple HTML elements, but it looks like any > class/html attributes are not cascading downwards to the individual tag > builders. > > /afb-- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Edx Erx wrote:> You can use > <span class="something"> > <%= date_select %> > </span>Doesn''t work. SELECTs seem to be very sensitive. What I am doing now is a variant on that, though: <span class="form_element"> <%= date_select %> </span> .form_element select { font-size: 10px; } That works, though it''s not ideal. Thanks for all the feedback. /afb -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---