I do have a Model called Community
I do have a attribute called author
in communities table.
I do have models/community.rb
However this won't work. Why?
@communities = Community.find_by_author(params[:author])
I do have a Model called Community
I do have a attribute called author
in communities table.
I do have models/community.rb
However this won't work. Why?
@communities = Community.find_by_author(params[:author])
find_by
will give only first matching record. So use where
to get all matching records.
Community.where(:author => params[:author])