-
-
Save slavajacobson/b6d1feb13b3264f753a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@movies = Movie.all(:hide.not => true) | |
@movies = @movies.all(:name.like => "%#{params[:title]}%", :genre.like => "%#{params[:genre]}%") | |
@movies = @movies.all(:year.gte => params[:from_year]) unless params[:from_year].blank? | |
@movies = @movies.all(:year.lte => params[:to_year]) unless params[:to_year].blank? | |
@movies = @movies.all(:cast.like => "%#{params[:actor]}%") unless params[:actor].blank? | |
@movies = @movies.all(:mpaa_rating.like => "%#{params[:mpaa_rating]}%") unless params[:mpaa_rating].blank? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment