Keep in mind that this string you are passing is entirely JavaScript.
company.id is a ruby expression, and only confuses your poor JS
interpreter which knows nothing of ruby.
Try this:
:with=>"‘company_id=’+#{company.id}"
Then ruby will insert the value of company.id as a string, which gets
passed to JS, serialized with the form, becomes part of the AJAX
request, etc. The value of company.id should arrive at the action as
params[:company_id].
Again we run into the same paradox: IE is the worst environment in
which to try to debug JS (seriously, you'd be better off debugging JS
at a rave, or underwater, or in a dark closet . . . its making me
queasy just thinking about it), and yet there are tons of quirky,
subtle IE-specific JS problems lurking out there. IE is bad!
Keep in mind that this string you are passing is entirely JavaScript.
company.id is a ruby expression, and only confuses your poor JS
interpreter which knows nothing of ruby.
Try this:
:with=>"‘company_id=’+#{company.id}"
Then ruby will insert the value of company.id as a string, which gets
passed to JS, serialized with the form, becomes part of the AJAX
request, etc. The value of company.id should arrive at the action as
params[:company_id].
Again we run into the same paradox: IE is the worst environment in
which to try to debug JS (seriously, you'd be better off debugging JS
at a rave, or underwater, or in a dark closet . . . its making me
queasy just thinking about it), and yet there are tons of quirky,
subtle IE-specific JS problems lurking out there. IE is bad!
Cheers,
Blake M.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.