chore(rubocop): giganto rubocop commit.

muahahahah
This commit is contained in:
Joseph Mastey
2017-12-05 18:46:21 -06:00
parent 284cd8811c
commit 9902345291
120 changed files with 743 additions and 635 deletions
+7 -6
View File
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class MessagesController < ApplicationController
def index
@@ -7,15 +8,15 @@ class MessagesController < ApplicationController
end
def show
@message = Message.where(:id => params[:id]).first
@message = Message.where(id: params[:id]).first
end
def destroy
message = Message.where(:id => params[:id]).first
message = Message.where(id: params[:id]).first
if message.destroy
flash[:success] = "Your message has been deleted."
redirect_to user_messages_path(:user_id => current_user.user_id)
redirect_to user_messages_path(user_id: current_user.user_id)
else
flash[:error] = "Could not delete message."
end
@@ -24,13 +25,13 @@ class MessagesController < ApplicationController
def create
if Message.create(message_params)
respond_to do |format|
format.html { redirect_to user_messages_path(:user_id => current_user.user_id) }
format.json { render :json => {:msg => "success"} }
format.html { redirect_to user_messages_path(user_id: current_user.user_id) }
format.json { render json: {msg: "success"} }
end
else
respond_to do |format|
format.html { redirect_to user_messages_path }
format.json { render :json => {:msg => "failure"} }
format.json { render json: {msg: "failure"} }
end
end
end