Skip to content

Commit

Permalink
Merge pull request #126 from yasmine-glitch/anyone-access-index
Browse files Browse the repository at this point in the history
anyone can see the index, no need to log in ;)
  • Loading branch information
yasmine-glitch authored Jan 17, 2022
2 parents 35a8b39 + c7ff163 commit b5e9d06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/activities_controller.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class ActivitiesController < ApplicationController
def index
@activities = policy_scope(Activity).order(start_date: :asc)
@user_hobbies = current_user.hobby_list
params[:categories] ||= []
@user_hobbies = current_user.present? ? current_user.hobby_list : params[:categories]

## RETURN THE RESULTS FROM THE HOMEPAGE SEARCH

Expand Down
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class ApplicationController < ActionController::Base
before_action :authenticate_user!
skip_before_action :authenticate_user!, only: :index
before_action :configure_permitted_parameters, if: :devise_controller?
include Pundit

Expand Down

0 comments on commit b5e9d06

Please sign in to comment.