Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
<%= link_to_function "Add new Item" do |page| claim_form.fields_for :items, Item.new, :child_index => 'NEW_RECORD' do |f| html = render(:partial => "claims/item_list", :locals => { :form => f }) page << "$$('tr.item').insert({ bottom: '#{escape_javascript(html)}'.replace(/NEW_RECORD/g, new Date().getTime()) });" end end%> # I have a: <tr class="item"></tr> # Got an error "RJS Error: Type Error: $$('tr.item').insert() is not a function"
This paste will be private.
From the Design Piracy series on my blog: