RJS returned javascript written straight to page


#1

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 = Credit.new()
p.id = rand.to_s[2…-1]
render :update do |page|
page.insert_html :bottom,
“script”,
:partial => ‘films/form/personnel’,
:locals => {
:type => @params[:type].gsub(//, “”),
:available_types => @credit_types.select {
|ct| ct.personnel_type == @params[:type] },
:personnel => p
}
page.visual_effect :highlight, @params[:type].gsub(/
/, “”),
end
end

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

d


#2

ignore this!

I forgot to remove the :update from my link_to_remote

sorry