I replaced Prototype with jQuery for Rails 3. Now I am trying to do the following:
#photo =render 'shared/photo' = link_to_function "Add a Photo" do |page| | page.insert_html :bottom, 'photo', :partial => 'shared/photo', :object => Photo.new | end |
So, the generated Javascript:
try { Element.insert("photo", { bottom: "Data\n\n" }); } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Element.insert(\"photo\", { bottom: \"Data\\n\\n\" });'); throw e }; return false;
In rails docs, insert_html is a Prototype helper, but I thought replacing Rails.js with https://github.com/rails/jquery-ujs will replace these helpers for JQuery Helpers. I get TypeError.ElementInsert is not a function.
Am I doing something wrong? Or will I do it myself without helpers?
jquery prototypejs ruby-on-rails ruby-on-rails-3
daniel
source share