From dbb97c5603805ef520a268f599063050c75983a2 Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Sun, 29 Oct 2017 15:58:36 -0500 Subject: [PATCH] Update posts_controller.rb fix indentation --- app/controllers/posts_controller.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 9499671..6d44cb0 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -1,21 +1,21 @@ class PostsController < ApplicationController -before_action :set_post, only: [:show, :edit, :update, :destroy] + before_action :set_post, only: [:show, :edit, :update, :destroy] -def set_post - @post = Post.find(params[:id]) -end + def set_post + @post = Post.find(params[:id]) + end -def upvote - @posts = Post.find(params[:id]) - @posts.votes.create - redirect_to(posts_path) -end + def upvote + @posts = Post.find(params[:id]) + @posts.votes.create + redirect_to(posts_path) + end -def downvote - @posts = Post.find(params[:id]) - @posts.votes.last.destroy - redirect_to(posts_path) -end + def downvote + @posts = Post.find(params[:id]) + @posts.votes.last.destroy + redirect_to(posts_path) + end def index