Greetings,
I''m trying to understand why I cannot output embedded ruby content
between div tags:
I have a div which I''m setting from a template and ruby code creating a
table rows:
<div id=''line_items''>
<% @packing_slip.packing_items.each_with_index do |@item, i| %>
<tr class=''altRow''>
<td align="center"><%= (i + 1) %></td>
<div id=''track''
style=''display:none;''>
<%= text_field "tracking_number", @item.tracking_number
%>
</div>
</tr>
<% end %>
</div>
When I view the selection source (ff 2.0 is neato!), line_items does
not contain the table rows:
<div id="line_items">
</div><tr class="altRow">
<td align="center">1</td>
<div id="track" style="display: none;">
<input size="30" name="tracking_number[]"
id="tracking_number_"
type="text">
</div>
</tr>
<tr class="altRow">
<td align="center">2</td>
<div id="track" style="display: none;">
<input size="30" name="tracking_number[]"
id="tracking_number_"
type="text">
</div>
</tr>
I thought perhaps it has something to do with embedding the code within
a remote_form_for and changed that to a form_for. Same thing. I know
that using only divs, without table tags, does wrap the field:
<div id="line_items">
<% @packing_slip.packing_items.each_with_index do |@item, i| %>
<div id=''track''
style=''display:none;''>
<%= text_field "tracking_number", @item.tracking_number
%>
</div>
<% end %>
</div>
<table width="100%">
<thead>
</thead>
<tbody>
<tr class="altRow">
<th>Item</th>
<th>RMA # </th>
<th>Part # </th>
<th>Description</th>
<th>Qty</th>
<th>Serial # </th>
<th>Tracking # </th>
</tr>
<div id="line_items">
<div style="display: none;" id="track">
<input size="30" name="tracking_number[]"
id="tracking_number_"
type="text">
</div>
<div style="display: none;" id="track">
<input size="30" name="tracking_number[]"
id="tracking_number_"
type="text">
</div>
</div>
</tbody>
</table>
However, I''d rather not sacrifice the table layout at this time. Any
thoughts are greatly appreciated!
Regards,
Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
<div id=''line_items''>
<% @packing_slip.packing_items.each_with_index do |@item, i| -%>
<tr class=''altRow''>
<td align="center"><%= (i + 1) %></td>
<div id=''track''
style=''display:none;''>
<%= text_field "tracking_number", @item.tracking_number
%>
</div>
</tr>
<% end -%>
</div>
there is now reason why this should not work exept that you are trying
to put tr/td''s in a div. It looks like your closing the line_items div
twice
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Thanks Keynan. I thought it would be possible to use both together. I will avoid doing that. -Dave On Nov 16, 8:31 am, Keynan Pratt <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> <div id=''line_items''> > <% @packing_slip.packing_items.each_with_index do |@item, i| -%> > <tr class=''altRow''> > <td align="center"><%= (i + 1) %></td> > <div id=''track'' style=''display:none;''> > <%= text_field "tracking_number", @item.tracking_number %> > </div> > </tr> > <% end -%> > </div> > > there is now reason why this should not work exept that you are trying > to put tr/td''s in a div. It looks like your closing the line_items div > twice > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---