RailsCasts Pro episodes are now free!

Learn more or hide this

tguevin's Profile

GitHub User: tguevin

Comments by

Avatar

The previous code works for new models, but you can get the existing id like this:

 <li id="entry_<%= f.object.id || f.object_name.gsub(/[^0-9]+/,'') %>">
Avatar

Coda, I found this link:
http://railsforum.com/viewtopic.php?id=40499

so your >> here? <<

could be something like

class => "net_device_<%= f.object_name.gsub(/[^0-9]+/,'') %>"

not sure about the content tag and how you specify the class/id for CSS.

I'm using a fieldset as follows:

 <fieldset id="entry_<%= f.object_name.gsub(/[^0-9]+/,'') %>">

Good luck :)