I just brought acts_as_taggable into an app and I have one question.
Is the following the best way to tag a brand new taggable item? (Note:
I’m grabbing the data from a form - I cut the code down to its basics
for the post.)
def save_story
story = Story.new(params[:story])
story.save
story.tag_with(params[:story][:tag_list])
story.save
end
Near as I can tell, it’s not possible to successfully tag a taggable
item until the item has an id. Saving the item once before tagging
will generate that id for me, allowing me to save the item a second
time, which registers the tagging information.