Rails ActiveRecord: HABTM find parameters?

You can also do this (though I'm not really a big fan of writing sql in queries), which will also return all notes with one of the supplied tag class Note :notes_tags def self. Find_with_tags(*tags) all(:joins => :notes_tags, :conditions => "notes_tags. Tag_id in (select id from tags where name in (?))", tags, :group => 'notes.Id') end end.

You can also do this (though I'm not really a big fan of writing sql in queries), which will also return all notes with one of the supplied tag. Class Note :notes_tags def self. Find_with_tags(*tags) all(:joins => :notes_tags, :conditions => "notes_tags.

Tag_id in (select id from tags where name in (?))", tags, :group => 'notes. Id') end end.

In the end, this is what I've been searching for: Note. Find(:all, :include=>:tags, :conditions => 'tags. Name in (?)','rss','xml').

That is, I would like to have a named route like /notes/with_tags/rss,javascript and need a class method on Note called find_with_tags(). I am currently using Tag.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions