Adding simple_form, adding profile settings, header image
This commit is contained in:
parent
1aa477ac2f
commit
3441361568
21 changed files with 344 additions and 4 deletions
27
app/controllers/settings_controller.rb
Normal file
27
app/controllers/settings_controller.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
class SettingsController < ApplicationController
|
||||
layout 'dashboard'
|
||||
|
||||
before_action :authenticate_user!
|
||||
before_action :set_account
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def update
|
||||
if @account.update(account_params)
|
||||
redirect_to settings_path
|
||||
else
|
||||
render action: :show
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def account_params
|
||||
params.require(:account).permit(:display_name, :note, :avatar, :header)
|
||||
end
|
||||
|
||||
def set_account
|
||||
@account = current_user.account
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue