Sha256: d14e4d401f50d6c1709249c15343c235d7f05457229b3f9158bc886157a44988

Contents?: true

Size: 712 Bytes

Versions: 18

Compression:

Stored size: 712 Bytes

Contents

module Locomotive
  class MyAccountController < BaseController

    sections 'settings', 'account'

    respond_to :json, only: [:update, :regenerate_api_key]

    helper 'Locomotive::Accounts'

    skip_load_and_authorize_resource

    def edit
      @account = current_locomotive_account
      respond_with @account
    end

    def update
      @account = current_locomotive_account
      @account.update_attributes(params[:account])
      respond_with @account, location: edit_my_account_path
    end

    def regenerate_api_key
      @account = current_locomotive_account
      @account.regenerate_api_key!
      respond_with({ api_key: @account.api_key }, location: edit_my_account_path)
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
locomotive_cms-2.5.7 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.5.6 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.5.6.rc2 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.5.6.rc1 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.5.5 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.5.4 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.5.3 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.5.2 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.5.1 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.5.0 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.5.0.rc3 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.5.0.rc2 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.5.0.rc1 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.4.1 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.4.0 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.3.1 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.3.0 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.2.3 app/controllers/locomotive/my_account_controller.rb