Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: smtm
RE: HTML Form help [ reply ]  
2006-11-29 04:30
This works to get the tags separated in the _form:
<%= text_field 'modelname','tag_names', :value =>@modelname.tag_names.join(" ")%>

By: Andreas Alin
RE: HTML Form help [ reply ]  
2006-06-16 17:07
tag_names returns an array, so a simpler way would be:

<%= @modelnamme.tag_names.join(" ") %>

By: Eric Wagoner
RE: HTML Form help [ reply ]  
2005-11-11 22:17
Here's my work-around:

<input id="modelname_tag_names" name="modelname[tag_names]" size="30" type="text" value="<% for tag in @modelname.tag_names %><%= tag %> <% end %>" />

It does the job, if there's not really a helper built into acts_as_taggable

By: Eric Wagoner
HTML Form help [ reply ]  
2005-11-11 19:59
I've got acts_as_taggable happily created tags for my models, but I've got a problem editing them.

In my form, I've got:

<%= text_field 'modelname' 'tag_names' %>

This creates the tags great, but when I call the same form to edit my object, the tags are all run together, i.e., "Tag1Tag2Tag3". If the form is sumbitted as is, the old tags are replaced with the single allruntogether tag.

How can I prevent this?