Skip to content

Commit

Permalink
Required user to be authenticated for certain controller actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sdflem committed Nov 2, 2018
1 parent 88f4f42 commit cfa4913
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class ApplicationController < ActionController::Base
before_action :authenticate_user!
end
2 changes: 2 additions & 0 deletions app/controllers/multiple_choice_questions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class MultipleChoiceQuestionsController < ApplicationController
skip_before_action :authenticate_user!, only: [:ask, :check_answer]

def ask
begin
@multiple_choice_question = MultipleChoiceQuestion.find(params[:id])
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class PagesController < ApplicationController
skip_before_action :authenticate_user!, only: [:home, :about, :sdflming]

def home
@quizzes = Quiz.all
# render 'home.html.erb'
Expand Down
1 change: 1 addition & 0 deletions app/controllers/quizzes_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class QuizzesController < ApplicationController
skip_before_action :authenticate_user!, only: [:home]

def home
begin
Expand Down

0 comments on commit cfa4913

Please sign in to comment.