I'm using haml 3.1.4 and haml-rails 0.3.5
The issue I'm having only occurs on the server (production) and locally (test) but not in development (both appear to be using the same gem versions)
=form_for @thing, :remote => true do |f|
=hidden_field_tag :template, 'thing'
%table
%thead
%tr
%th
Name
%th
=image_tag 'cancel.png'
%tbody
=f.fields_for :items do |item_fields|
%tr
%td
=f.text_field :name
%td
=f.submit 'Save'
it outputs the following html save text:
<input type='hidden' value='thing' /><table><thead><tr><th>Name</th><th><img src='cancel.png.....' /></tr></thead>
followed be the rendered html above.
How can I narrow down what the differences are between test/production and development?
Any ideas? :)
EDIT: It might be worth mentioning that this is the second form for '@thing' on the page. The first one renders fine, the second one is where the issue is.
I have a couple theories.
Whitespace is very important in haml. Is it possible you have a tab somewhere and whitespaces elsewhere?
Do both your form_for
s have remote: true
? That creates some extra div output which I suppose could confuse the DOM if it's reusing ids.
Are you sure you are using the =
on form_for
because without it, it won't output the HTML form tags.
I'm afraid I'm just guessing, and none of these would explain why it works in development.
Perhaps it helps...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With