Update: deleted since it is now redundant
Update: switch to acts_as_taggable_on_steroids more features, less pain/bugs 🙂
Need simple input/output for tags and got acts_as_taggable_on_steroids ?
and in your forms:
#Spec: it "does not create duplicated tags" do @taggable.tag_list = "Bad, Bad, Evil" @taggable.save! @taggable.tags.size.should == 2 end #Often need count of Tags ? #taggings.rb belongs_to :tag, :counter_cache=>'taggings_count'
3 thoughts on “Simple Tag IO with acts_as_taggable_on_steroids”
xplanation of tags is good using as reference
i am implementing a application using acts as taggable.
my app contain tables like
for tag support
my requirement is i want to search the data from streams table using tagname assing to the streams table entry.
to achieve this i have modifid my code like:
1)i am typing the tagname in search box.
2)the enterd text is recieved and to search with the text i have added a methos called get_results like:
if params[‘search_text’].strip.length > 0
terms = params[‘search_text’].split.collect do |word|
flash[:notice] = ‘Stream was successfully updated.’
#@streams = Stream.find_tagged_with(
@streams = Stream.find(:all, :joins => “streams inner join tags as t on
stream.id=t.id”, :conditions => [‘name LIKE ?’,’%’+params[:search_text]+’%’],select => “name”)
render :partial => “search”
redirect_to :action => “index”
i am getting erros like :
wrong number of arguments (0 for 1)
how to use Stream.find_taggable_with in the search method instead of writing the query?
as far as i understand your problem you are trying to find everything tagged with %name% AND %other% so if Stream1 is tagged with” myname” AND “myother” it should be found ?
judging from a quick code review, this should be accomplished by
hope this helps 🙂
if not, you could try asking the authors…