Hi,
I’m getting a Javascript error using tried and true RailsCast code!
I’m submitting a single form for one object (ec_order), which has many
of another object (ec_line_item) within it. I have links to add and
remove items in the form. Here is the view:
<% form_for :ec_order, :url => ‘summary’ do |f| %>
Item | |
| |
<%= submit_tag("Submit Form") %> |
and here is the partial
<%= ec_line_item_form.text_field :prescription_number %> | <%= ec_line_item_form.text_field :description %> | <%= link_to_function "remove", "this.up('.ec_line_item').remove()" %> |
Prescription Number | Description |
When I click on the “remove” link I get the JS error
“this.up(”.ec_line_item") has no properties". Any ideas what I’m
doing wrong? - Dave