babu nair wrote:
> Hi Tony,
> 
> Hope ur using Jquery
> 
> Add the class to the remove link and add the following line of code
>> <div class="fields">
>>   <%= f.error_messages %>
>> 
>>   <p>
>>     <%= f.text_field :content %>
>> 
>>     <% unless f.object.new_record? %>
>>     <%= link_to_remove_fields "remove", f,:class=>"remove" %>
>>     <% end %>
>>   </p>
>> </div>
> $(document).ready(function(){
> $(".remove").eq(0).remove()
> })
> 


Thank you!!

Using jquery now! Is there really that big of a difference? I know 
everybody raves about it - more lightweight is all?

For others to learn here's what I did.

1. I put babu's script in the bottom of the form (eventually I'll put it 
in the head via a yield).
2. Put the link_to_remove_fields in a span with class remove (<span 
class="remove"><%= link_to_remove_fields "remove", f %></span>)

That's it! Hope this helps someone else out there.



-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to