Something like:
<%= select("event","state_id",State.find_all, {},
{:onchange =>
"functionA(...)"}) %>
If you look at the docs for the select helper method, the final
argument is the html_options hash - in this you can set most
attributes of the HTML tag, as above (such as class, title, etc...)
- james
On 11/6/05, Neeraj Kumar
<neeraj.jsr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I have the following code:
>
> <%=
select("event","state_id",State.find_all) %>
>
>
> I would like to have rendered code something like this.
>
>
> <select name="event_state_id"
> onChange=''javascript:functionA(...)''>
>
>
> How do I pass the instructions to select utility method so that the
> rendered page has onchange javascript?
>
> Thanks.
> -=- Neeraj
>
>
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>