Skip to content

Commit

Permalink
adding devise filters to controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
jatwell93 committed Jun 5, 2017
1 parent 0d1fef7 commit 3710792
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 79 deletions.
2 changes: 1 addition & 1 deletion app/controllers/feeds_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class FeedsController < ApplicationController

before_action :authenticate_user!
def new
@feed = Feed.new
end
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/ingredients_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class IngredientsController < ApplicationController
before_action :require_user, except: [:show]
before_action :authenticate_user!, except: [:show, :index, :like, :search]
before_action :require_user, except: [:show]

def show
@ingredient = Ingredient.find(params[:id])
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class PagesController < ApplicationController

def home
redirect_to recipes_path if logged_in?

#not sure if this is what we want anymore in-terms of user experience - Josh
end

end
2 changes: 1 addition & 1 deletion app/controllers/preptimes_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class PreptimesController < ApplicationController

before_action :authenticate_user!
def new
@preptime = Preptime.new
end
Expand Down
74 changes: 0 additions & 74 deletions app/controllers/reviews_controller.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/helpers/exercises_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module ExercisesHelper

def exercise_owner?
owner_check(@exercises.user_id)
owner_check(@exercises)
end

end

0 comments on commit 3710792

Please sign in to comment.