Ruby on Rails Saturday, January 29, 2011

On Jan 29, 3:14 am, Me <chabg...@gmail.com> wrote:
> Is there a way to to put the id from the select into the id of the url
> instead of the :with param?
>

Instead of using remote_function, write your own js function (in
application.js). Then change the onchange to myfunction(this.value),
or attach an event handler to it.

Fred
> = collection_select :category, :id, Category.all, :id, :name, {:prompt =>
> 'None'}, :onchange =>
> remote_function(:url=>{:controller=>'sub_categories',:action=>'get_sub_cate gories',:id=>'1'},:method=>'get',:with=>"'myid='
> + this.value")

--
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@googlegroups.com.
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.

No comments:

Post a Comment