Forum: Ruby on Rails RJS returned javascript written straight to page

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Dorian M. (Guest)
on 2006-05-20 07:53
(Received via mailing list)
hi there,
I have in my controller, the following to catch a link_to_remote:

  def form_part_add_personnel
    @credit_types = CreditType.find(:all)
    p = = rand.to_s[2..-1]
    render :update do |page|
      page.insert_html  :bottom,
                        :partial => 'films/form/personnel',
                        :locals => {
                          :type => @params[:type].gsub(/_/, ""),
                          :available_types => {
|ct| ct.personnel_type == @params[:type] },
                          :personnel => p
      page.visual_effect :highlight, @params[:type].gsub(/_/, ""),

whenever I use this, the generated javascript just gets pasted right in
like this. over the top of everything else in the div it's supopsed to
be inserting into:
new Insertion.Bottom("script", "  <div class=\"repeatGroup\"
id=\"script_701127528526052\">\n    <p class=\"removeControl\"> etc...

I'm running 1.1.2, I've updated my scripts, but I can't seem to get this
to work...

any ideas?

head banging

Dorian M. (Guest)
on 2006-05-20 08:32
(Received via mailing list)
ignore this!

I forgot to remove the :update from my link_to_remote

This topic is locked and can not be replied to.