I have a model Post that has_many :tags
I want to do:
Post.create({:tags => ['tag1', 'tag2']})
How can I make that work?
I have a model Post that has_many :tags
I want to do:
Post.create({:tags => ['tag1', 'tag2']})
How can I make that work?
Use the acts-as-taggable-on gem.
class Post < ActiveRecord::Base
acts_as_taggable_on :tags
end
Post.create(:tag_list => ['tag1', 'tag2'])