My app has two models Genre and Movie. I want to search movies by Movie Title and Genre Name. The association between these two models is a "has many - belongs to" relationship and not a "has one"[1]
This is what my Movie model looks like:
This is what my Movie model looks like:
class Movie < ActiveRecord::Base
belongs_to :genre
searchable do
text :title
text :genre do
category.name
end
end
end
[1] - My previous post on the "has many" association
No comments :
Post a Comment