Skip to content

Commit

Permalink
Test filtering v1.29
Browse files Browse the repository at this point in the history
  • Loading branch information
luongm committed Mar 17, 2012
1 parent 9af190a commit 109133b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/controllers/movies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ def index
@all_ratings = Movie.all_ratings
if (params[:filter] != nil)
@filtered_ratings = params[:filter].scan(/[\w-]+/)
if (@filtered_ratings.length == 4)
@filtered_ratings = []
end
else
@filtered_ratings = params[:ratings] ? params[:ratings].keys : []
end
puts "[LOOKKKKKK]"
puts @filtered_ratings
if (params[:sort] == "title") # Sort by titles
if (params[:ratings]) # filter ratings
@movies = Movie.find(:all, :conditions => {:rating => @filtered_ratings}, :order => "title")
Expand Down

0 comments on commit 109133b

Please sign in to comment.