Class: UsersController

Inherits:
ApplicationController show all
Includes:
WithUserParams
Defined in:
app/controllers/users_controller.rb

Instance Method Summary collapse

Methods included from WithUserParams

#permissible_params, #user_params

Methods inherited from ApplicationController

#current_workspace, #login_button, #redirect_to_main_organization!, #redirect_to_usage, #should_choose_organization?, #should_redirect_to_main_organization?, #validate_accessible!, #validate_active_organization!

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_count, #user_notifications_path

Methods included from Mumuki::Laboratory::Controllers::Disabling

#ensure_user_enabled!

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

#showObject



7
8
9
10
# File 'app/controllers/users_controller.rb', line 7

def show
  @messages = current_user.messages.to_a
  @watched_discussions = current_user.watched_discussions_in_organization
end

#unsubscribeObject



17
18
19
20
21
22
# File 'app/controllers/users_controller.rb', line 17

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

#updateObject



12
13
14
15
# File 'app/controllers/users_controller.rb', line 12

def update
  current_user.update_and_notify! user_params
  redirect_to root_path, notice: I18n.t(:user_data_updated)
end