adds basic 'my account' page
Fields related with authentication are not included because the auth system will change to integrate with Madrid.es's Ciudadano360 ref: #22
This commit is contained in:
23
app/controllers/account_controller.rb
Normal file
23
app/controllers/account_controller.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
class AccountController < ApplicationController
|
||||
|
||||
before_action :authenticate_user!
|
||||
before_action :set_account
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def update
|
||||
flash[:notice] = t("flash.actions.save_changes.notice") if @account.update(account_params)
|
||||
redirect_to account_path
|
||||
end
|
||||
|
||||
private
|
||||
def set_account
|
||||
@account = current_user
|
||||
end
|
||||
|
||||
def account_params
|
||||
params.require(:account).permit(:first_name, :last_name)
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user