Sha256: f50c16b60adac7fcec677e1e75804745964c3a43bea1f546d34473615f1273c5

Contents?: true

Size: 775 Bytes

Versions: 21

Compression:

Stored size: 775 Bytes

Contents

module Spina
  module Admin
    class AccountsController < AdminController
      admin_section :settings
      
      before_action :set_breadcrumbs

      def edit
      end

      def update
        if current_account.update(account_params)
          redirect_back fallback_location: spina.edit_admin_account_path, flash: {success: t('spina.accounts.saved')}
        else
          flash.now[:error] = t('spina.accounts.couldnt_be_saved')
          render :edit, status: :unprocessable_entity
        end
      end

      private

        def account_params
          params.require(:account).permit!
        end
        
        def set_breadcrumbs
          add_breadcrumb I18n.t('spina.preferences.account'), spina.edit_admin_account_path
        end

    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
spina-2.11.0 app/controllers/spina/admin/accounts_controller.rb
spina-2.10.0 app/controllers/spina/admin/accounts_controller.rb
spina-2.9.1 app/controllers/spina/admin/accounts_controller.rb
spina-2.9.0 app/controllers/spina/admin/accounts_controller.rb
spina-2.8.1 app/controllers/spina/admin/accounts_controller.rb
spina-2.8.0 app/controllers/spina/admin/accounts_controller.rb
spina-2.7.0 app/controllers/spina/admin/accounts_controller.rb
spina-2.6.2 app/controllers/spina/admin/accounts_controller.rb
spina-2.6.1 app/controllers/spina/admin/accounts_controller.rb
spina-2.6.0 app/controllers/spina/admin/accounts_controller.rb
spina-2.5.0 app/controllers/spina/admin/accounts_controller.rb
spina-2.4.0 app/controllers/spina/admin/accounts_controller.rb
spina-2.3.5 app/controllers/spina/admin/accounts_controller.rb
spina-2.3.4 app/controllers/spina/admin/accounts_controller.rb
spina-2.3.3 app/controllers/spina/admin/accounts_controller.rb
spina-2.3.2 app/controllers/spina/admin/accounts_controller.rb
spina-2.3.1 app/controllers/spina/admin/accounts_controller.rb
spina-2.3.0 app/controllers/spina/admin/accounts_controller.rb
spina-2.2.0 app/controllers/spina/admin/accounts_controller.rb
spina-2.1.1 app/controllers/spina/admin/accounts_controller.rb