From 78bda1fc5fc703cb53959f1b86aa5fb01a91d06b Mon Sep 17 00:00:00 2001 From: nilsding Date: Tue, 11 Nov 2014 19:53:25 +0100 Subject: [PATCH] now requiring authentication on certain pages --- app/controllers/inbox_controller.rb | 2 ++ app/controllers/user_controller.rb | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/inbox_controller.rb b/app/controllers/inbox_controller.rb index 47353289..076e1264 100644 --- a/app/controllers/inbox_controller.rb +++ b/app/controllers/inbox_controller.rb @@ -1,4 +1,6 @@ class InboxController < ApplicationController + before_filter :authenticate_user! + def show @inbox = Inbox.where(user: current_user).order(:created_at).reverse_order end diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 3245c234..ae5222f3 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -4,10 +4,11 @@ class UserController < ApplicationController end def edit - + authenticate_user! end def update + authenticate_user! params.require(:display_name) current_user.display_name = params[:display_name] current_user.save!