Class: My::ProfilesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- My::ProfilesController
- Includes:
- Authentication, ProcessedForms, RestrictedAccess
- Defined in:
- app/controllers/my/profiles_controller.rb
Overview
Managing profile for current user
Instance Method Summary collapse
-
#check ⇒ Object
post /my/profile/check.
-
#create ⇒ Object
post /my/profile.
-
#edit ⇒ Object
get /my/profile/edit.
-
#new ⇒ Object
get /my/profile/new.
-
#show ⇒ Object
get /my/profile.
-
#update ⇒ Object
patch /my/profile.
Methods included from Authentication
#cookie_data, #create_token_for_user, #deactivate_token, #pop_token, #redirect_authenticated_user
Instance Method Details
#check ⇒ Object
post /my/profile/check
13 14 15 16 |
# File 'app/controllers/my/profiles_controller.rb', line 13 def check code = Code.active.find_by(body: param_from_request(:code)) registration_handler.check(creation_parameters.to_h, code) end |
#create ⇒ Object
post /my/profile
26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/my/profiles_controller.rb', line 26 def create if params[:agree] metric = Biovision::Components::UsersComponent::METRIC_REGISTRATION_BOT component_handler.register_metric(metric) redirect_to root_path, alert: t('.are_you_bot') else create_user end end |
#edit ⇒ Object
get /my/profile/edit
41 42 |
# File 'app/controllers/my/profiles_controller.rb', line 41 def edit end |
#new ⇒ Object
get /my/profile/new
19 20 21 22 23 |
# File 'app/controllers/my/profiles_controller.rb', line 19 def new @entity = User.new render :closed unless component_handler.registration_open? end |
#show ⇒ Object
get /my/profile
37 38 |
# File 'app/controllers/my/profiles_controller.rb', line 37 def show end |
#update ⇒ Object
patch /my/profile
45 46 47 48 49 50 51 52 53 |
# File 'app/controllers/my/profiles_controller.rb', line 45 def update @entity = current_user if component_handler.update_user(@entity, user_parameters, profile_parameters) flash[:notice] = t('.success') form_processed_ok(my_path) else form_processed_with_error(:edit) end end |