Class: UsersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- UsersController
- Includes:
- WithUserParams
- Defined in:
- app/controllers/users_controller.rb
Instance Method Summary collapse
- #accept_profile_terms ⇒ Object
- #activity ⇒ Object
- #certificates ⇒ Object
- #discussions ⇒ Object
- #messages ⇒ Object
- #permissible_params ⇒ Object
- #terms ⇒ Object
- #unsubscribe ⇒ Object
- #update ⇒ Object
Methods included from WithUserParams
#user_name_params, #user_params
Methods inherited from ApplicationController
#current_immersive_organizations, #current_immersive_path, #current_immersive_path_for, #current_workspace, #immersive_context_wrong?, #login_button, #redirect_to_proper_context!, #redirect_to_usage, #should_choose_organization?, #validate_accessible!, #validate_active_organization!
Methods included from Mumuki::Laboratory::Controllers::ActionRedirector
#redirect_after!, #save_location_before!
Methods included from Mumuki::Laboratory::Controllers::IncognitoMode
#current_incognito_user?, #current_logged_user?, #current_user, #current_user?, #incognito_mode_enabled?
Methods included from Mumuki::Laboratory::Controllers::EmbeddedMode
#embedded_mode?, #enable_embedded_rendering, #standalone_mode?
Methods included from Mumuki::Laboratory::Controllers::DynamicErrors
#bad_record, #blocked_forum, #disabled, #disabled_organization, #forbidden, #gone, #internal_server_error, #not_found, #render_error, #unauthorized, #unprepared_organization
Methods included from Mumuki::Laboratory::Controllers::Notifications
#has_notifications?, #notifications, #notifications_count
Methods included from Mumuki::Laboratory::Controllers::Disabling
Methods included from Mumuki::Laboratory::Controllers::Authorization
#authorization_slug, #authorize_if_private!
Methods included from Mumuki::Laboratory::Controllers::CurrentOrganization
#organization_name, #set_current_organization!, #visit_organization!
Instance Method Details
#accept_profile_terms ⇒ Object
15 16 17 18 19 |
# File 'app/controllers/users_controller.rb', line 15 def accept_profile_terms current_user.accept_profile_terms! flash.notice = I18n.t(:terms_accepted) redirect_after! :terms_acceptance, fallback_location: root_path end |
#activity ⇒ Object
33 34 35 |
# File 'app/controllers/users_controller.rb', line 33 def activity @activity = UserStats.stats_for(current_user).activity date_range_params end |
#certificates ⇒ Object
37 38 39 |
# File 'app/controllers/users_controller.rb', line 37 def certificates @certificates ||= current_user.certificates_in_organization end |
#discussions ⇒ Object
29 30 31 |
# File 'app/controllers/users_controller.rb', line 29 def discussions @watched_discussions = current_user.watched_discussions_in_organization end |
#messages ⇒ Object
25 26 27 |
# File 'app/controllers/users_controller.rb', line 25 def @messages ||= current_user. end |
#permissible_params ⇒ Object
48 49 50 |
# File 'app/controllers/users_controller.rb', line 48 def permissible_params super << [:avatar_id, :avatar_type] end |
#terms ⇒ Object
21 22 23 |
# File 'app/controllers/users_controller.rb', line 21 def terms @profile_terms ||= Term.profile_terms_for(current_user) end |
#unsubscribe ⇒ Object
41 42 43 44 45 46 |
# File 'app/controllers/users_controller.rb', line 41 def unsubscribe user_id = User.unsubscription_verifier.verify(params[:id]) User.find(user_id).unsubscribe_from_reminders! redirect_to root_path, notice: t(:unsubscribed_successfully) end |
#update ⇒ Object
8 9 10 11 12 13 |
# File 'app/controllers/users_controller.rb', line 8 def update current_user.update_and_notify! user_params current_user.accept_profile_terms! flash.notice = I18n.t(:user_data_updated) redirect_after! :profile_completion, fallback_location: user_path end |