How can I use form_remote_tag to update an acts_as_taggable_on field?

Posted by Angela on Stack Overflow See other posts from Stack Overflow or by Angela
Published on 2010-05-21T04:45:00Z Indexed on 2010/05/21 4:50 UTC
Read the original article Hit count: 173

I have a model called Company which is acts_as_taggable_on.

When I am /SHOWing a Company (e.g. company/15) I want to be able to see a form that allows me to add tags. I suppose this would be easier by just allowing at edit but sometimes I want to go back and just add tags.

This is what I tried to do and I get an error:

<div id = 'tags'>
  <strong>Tags:</strong>
  <% form_remote_tag(:url => {:action => 'update'},
                     :update => 'tags') do  %>
    <%= text_field :company, :tag_list %>   
       <%= submit_tag 'Save' %> 
  <% end %>
</div>

Thanks!

© Stack Overflow or respective owner

Related posts about acts-as-taggable

Related posts about ruby-on-rails