Hi,
I''ve looked on api.rubyonrails.org but I''ve not found how to
add to a
date_select(object, method, options = {}) a class option to set the
class of all the select tags.
I''ve tried using "class" => "myclass" in thoose
ways:
<%= date_select("costo", "data", "class" =>
"testo" ) %>
<%= date_select("costo", "data", :use_month_numbers =>
true, :order =>
[:day, :month, :year], "class" => "testo" ) %>
but nothing is added to the html code...
This way usually works with:
<%= text_area("costo","descrizione","class"
=> "testo") %>
Thanks for the suggestions...
date_select({ "foo", "bar" }, "class" =>
"baz")
or
date_select("foo", "bar", { "class" =>
"baz" })
...I can never remember which one it is though..
-- johan
On Tue, 15 Feb 2005 14:32:53 +0100, Enrico Teotti
<agenteo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi,
> I''ve looked on api.rubyonrails.org but I''ve not found how
to add to a
> date_select(object, method, options = {}) a class option to set the
> class of all the select tags.
> I''ve tried using "class" => "myclass" in
thoose ways:
> <%= date_select("costo", "data", "class"
=> "testo" ) %>
> <%= date_select("costo", "data", :use_month_numbers
=> true, :order =>
> [:day, :month, :year], "class" => "testo" ) %>
> but nothing is added to the html code...
> This way usually works with:
> <%=
text_area("costo","descrizione","class" =>
"testo") %>
>
> Thanks for the suggestions...
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Johan Sørensen
Professional Futurist
www.johansorensen.com
On 15.2.2005, at 16:45, Johan Sörensen wrote:> date_select({ "foo", "bar" }, "class" => "baz") > or > date_select("foo", "bar", { "class" => "baz" }) > > ...I can never remember which one it is though..Are you sure? From looking at the code I think that class is not a valid option for select helpers (it is for text_area). Enrico, if you can''t get this working you might want to wrap the helper inside a div and apply the class to that div. Then change your css rules from option#myclass to #myclass option. //jarkko -- Jarkko Laine http://jlaine.net http://odesign.fi _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Tue, 15 Feb 2005 16:51:13 +0200, Jarkko Laine <jarkko-k1O+Gnc6WpmsTnJN9+BGXg@public.gmane.org> wrote:> Are you sure? From looking at the code I think that class is not a > valid option for select helpers (it is for text_area).You''re right, I spoke too soon. date_select (and the rest of the date select helpers it seems) doesn''t have html_options my mistake, apologies. On Tue, 15 Feb 2005 16:51:13 +0200, Jarkko Laine <jarkko-k1O+Gnc6WpmsTnJN9+BGXg@public.gmane.org> wrote:> > On 15.2.2005, at 16:45, Johan Sörensen wrote: > > > date_select({ "foo", "bar" }, "class" => "baz") > > or > > date_select("foo", "bar", { "class" => "baz" }) > > > > ...I can never remember which one it is though.. > > Are you sure? From looking at the code I think that class is not a > valid option for select helpers (it is for text_area). > > Enrico, if you can''t get this working you might want to wrap the helper > inside a div and apply the class to that div. Then change your css > rules from option#myclass to #myclass option. > > //jarkko > > -- > Jarkko Laine > http://jlaine.net > http://odesign.fi > > >-- Johan Sørensen Professional Futurist www.johansorensen.com
This way:
date_select({ "foo", "bar" }, "class" =>
"baz")
the HTML output is:
<select name="costodata[classtesto(1i)]">
bla bla
</select>
And using:
<%= date_select({"costo", "data"}, :use_month_numbers
=> true, :order
=> [:day, :month, :year], "class" => "testo") %>
the HTML output is:
<select
name="costodata[classtestouse_month_numberstrueorderdaymonthyear(1i)]">
I''ve applied a patch (http://dev.rubyonrails.org/ticket/619) to permit
an arbitrary order of day,month and year
Maybe it... ?