Class: PostsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/posts_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



12
13
14
15
16
17
# File 'app/controllers/posts_controller.rb', line 12

def index
  @posts = Post.all
  respond_to do |format|
    format.html # index.html.erb
  end
end

#showObject



3
4
5
6
7
8
9
10
11
# File 'app/controllers/posts_controller.rb', line 3

def show
  @post     = Post.find(params[:id])
  @comment  = Comment.new
  @comments = @post.comments.where(:approved=>true)
  @tags     = @post.tags
  respond_to do |format|
    format.html # index.html.erb
  end
end