Class: PostsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- PostsController
- Defined in:
- app/controllers/posts_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
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 |
#show ⇒ Object
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) = @post. respond_to do |format| format.html # index.html.erb end end |