-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78f91b8
commit ef19d42
Showing
40 changed files
with
751 additions
and
714 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
class ApplicationController < ActionController::Base | ||
# Prevent CSRF attacks by raising an exception. | ||
# For APIs, you may want to use :null_session instead. | ||
protect_from_forgery with: :exception | ||
protect_from_forgery :with => :exception | ||
|
||
before_filter :configure_permitted_parameters, if: :devise_controller? | ||
before_filter :configure_permitted_parameters, :if => :devise_controller? | ||
|
||
protected | ||
#permit additional devise user parameters | ||
def configure_permitted_parameters | ||
devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:username) } | ||
devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username) } | ||
devise_parameter_sanitizer.for(:edit_user) { |u| u.permit(:username, :email) } | ||
end | ||
# permit additional devise user parameters | ||
def configure_permitted_parameters | ||
devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:username) } | ||
devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username) } | ||
devise_parameter_sanitizer.for(:edit_user) { |u| u.permit(:username, :email) } | ||
end | ||
|
||
#for use with Devise | ||
def require_admin | ||
unless current_user && current_user.admin | ||
flash[:alert] = "You must sign in to view this page" | ||
redirect_to new_user_session_path | ||
end | ||
# for use with Devise | ||
def require_admin | ||
unless current_user && current_user.admin | ||
flash[:alert] = "You must sign in to view this page" | ||
redirect_to new_user_session_path | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ def home | |
|
||
def about | ||
end | ||
|
||
def terms | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.