Js insert this.value into id

Is there a way to to put the id from the select into the id of the url
instead of the :with param?

= collection_select :category, :id, Category.all, :id, :name, {:prompt
=>
‘None’}, :onchange =>
remote_function(:url=>{:controller=>‘sub_categories’,:action=>‘get_sub_categories’,:id=>‘1’},:method=>‘get’,:with=>"‘myid=’

  • this.value")

On Jan 29, 3:14am, Me [email protected] 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs