Sha256: f51320155adcc21f8003ac6cb32df20519b3f72ce205765322c06188d2d77b52
Contents?: true
Size: 400 Bytes
Versions: 10
Compression:
Stored size: 400 Bytes
Contents
class PostsController < ApplicationController def index @posts = Post.all @recent_comments = Comment.with_state(:published) .where(commentable_state: [:published]) .recent.page(params[:page]) end def show @post = Post.find params[:id] @comments = @post.comments.with_state([:draft, :published]).nested_set end end
Version data entries
10 entries across 10 versions & 3 rubygems