RailsCasts Pro episodes are now free!

Learn more or hide this

Coda's Profile

GitHub User: coda4k

Comments by Coda

Avatar

Wow, thank you VERY MUCH, tguevin!! I will absolutely give it a try! :)

I really appreciate your help.. you've made my day :P

Avatar

Hi guys!

I'm having a little problem trying to understand 'content_tag_for', could you please give me a hint?

I'm not pretty sure how to get/use the IDs from inside a partial :( here is my code:

form.html.erb
<ul id="net1" class="connectedSortable">
  <%= f.simple_fields_for :net_devices do |netdev| %>
  <%= render 'net_device_fields', :f => netdev %>
  <% end %>
</ul>
_net_device_fields.html.erb
<%= content_tag_for :li, >>here?<< do %>
  <span class="handle"><%= image_tag("icons/grippy.png", :alt => "Drag and Drop! :)") %></span>
  <%= f.text_field :dev_name, :placeholder => "name", :size => 7, :maxlength => 7 %>
  <%= f.text_field :mac_address, :placeholder => "mac address", :size => 16, :maxlength => 16 %>
  <%= link_to_remove_fields "remove", f %>
<% end %>

Thanks in advance! :D

Avatar

Thank you very much for this tutorial Ryan!!

Just one quick question: Is there any way to adapt this solution to 'simple_form'?

Thanks in advance!!