Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CommentsController < ApplicationController
- before_filter :find_post
- def index
- @comments = case params[:filters]
- when 'by_quality' : @post.comments_by_quality(params[:page])
- when 'by_created_at' : @post.comments_by_created_at(params[:page])
- else
- @post.comments_by_quality(params[:page])
- end
- end
- private
- def find_post
- @post = Post.find(params[:post_id])
- end
- end
Add Comment
Please, Sign In to add comment