Class: My::ProfilesController

Inherits:
ApplicationController
  • Object
show all
Includes:
Authentication
Defined in:
app/controllers/my/profiles_controller.rb

Overview

Controller for registration and profile management

Instance Method Summary collapse

Methods included from Authentication

#create_token_for_user, #deactivate_token, #pop_token, #redirect_authenticated_user

Instance Method Details

#checkObject

post /my/profile/check



14
15
16
# File 'app/controllers/my/profiles_controller.rb', line 14

def check
  @entity = User.new(creation_parameters)
end

#createObject

post /my/profile



26
27
28
29
30
31
32
# File 'app/controllers/my/profiles_controller.rb', line 26

def create
  if params[:agree]
    redirect_to root_path, alert: t('my.profiles.create.are_you_bot')
  else
    create_user
  end
end

#editObject

get /my/profile/edit



39
40
# File 'app/controllers/my/profiles_controller.rb', line 39

def edit
end

#newObject

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 @handler.open?
end

#showObject

get /my/profile



35
36
# File 'app/controllers/my/profiles_controller.rb', line 35

def show
end

#updateObject

patch /my/profile



43
44
45
46
47
48
49
50
51
# File 'app/controllers/my/profiles_controller.rb', line 43

def update
  @entity = current_user
  if @entity.update(user_parameters)
    flash[:notice] = t('my.profiles.update.success')
    form_processed_ok(my_path)
  else
    form_processed_with_error(:edit)
  end
end