Class: DmCore::Admin::AccountsController
- Inherits:
-
AdminController
- Object
- AdminController
- DmCore::Admin::AccountsController
- Includes:
- PermittedParams
- Defined in:
- app/controllers/dm_core/admin/accounts_controller.rb
Instance Method Summary collapse
-
#analytics ⇒ Object
——————————————————————————.
-
#create_account ⇒ Object
——————————————————————————.
-
#email ⇒ Object
PUT /admin/account or PUT /admin/account/.json ——————————————————————————.
-
#general ⇒ Object
——————————————————————————.
-
#media ⇒ Object
——————————————————————————.
-
#metadata ⇒ Object
——————————————————————————.
-
#new_account ⇒ Object
——————————————————————————.
-
#show ⇒ Object
——————————————————————————.
Methods included from PermittedParams
#account_params, #comment_params, #devise_sign_up_params, #user_params, #user_profile_direct_params, #user_profile_params
Instance Method Details
#analytics ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 61 def analytics if put_or_post? @account.analytics_validation = true params[:account].delete(:preferred_sofort_project_password) if params[:account][:preferred_sofort_project_password].blank? params[:account].delete(:preferred_sofort_notification_password) if params[:account][:preferred_sofort_notification_password].blank? if @account.update_attributes(account_params) redirect_to(dm_core.admin_account_analytics_path, notice: "Account was successfully updated.") and return else render action: "analytics" end end end |
#create_account ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 22 def create_account redirect_to dm_core.admin_account_general_path(current_account) unless is_sysadmin? @account = Account.new(account_params) @account.general_validation = true if @account.save redirect_to dm_core.admin_account_general_path(@account), notice: 'New Account/Site was successfully created.' else render action: :general end end |
#email ⇒ Object
PUT /admin/account or PUT /admin/account/.json
48 49 50 51 52 53 54 55 56 57 58 |
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 48 def email if put_or_post? @account.email_validation = true params[:account].delete(:preferred_smtp_password) if params[:account][:preferred_smtp_password].blank? if @account.update_attributes(account_params) redirect_to(dm_core.admin_account_email_path, notice: "Account was successfully updated.") and return else render action: "email" end end end |
#general ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 35 def general if put_or_post? @account.general_validation = true if @account.update_attributes(account_params) redirect_to(dm_core.admin_account_general_path, notice: "Account was successfully updated.") and return else render action: "general" end end end |
#media ⇒ Object
87 88 89 90 91 92 93 94 95 96 |
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 87 def media if put_or_post? @account.media_validation = true if @account.update_attributes(account_params) redirect_to(dm_core.admin_account_media_path, notice: "Account was successfully updated.") and return else render action: "media" end end end |
#metadata ⇒ Object
75 76 77 78 79 80 81 82 83 84 |
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 75 def if put_or_post? @account. = true if @account.update_attributes(account_params) redirect_to(dm_core., notice: "Account was successfully updated.") and return else render action: "metadata" end end end |
#new_account ⇒ Object
15 16 17 18 19 |
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 15 def new_account redirect_to dm_core.admin_account_general_path(current_account) unless is_sysadmin? @account = Account.new render action: :general end |
#show ⇒ Object
10 11 12 |
# File 'app/controllers/dm_core/admin/accounts_controller.rb', line 10 def show redirect_to dm_core.admin_account_general_path(@account) end |