Sha256: 252384eada56e0b7cf7627f758c72e9f732ec893a8e657cc7beae367971098c8

Contents?: true

Size: 710 Bytes

Versions: 8

Compression:

Stored size: 710 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_url
    end

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

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
locomotive_cms-2.2.2 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.2.1 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.2.0 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.1.4 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.1.3 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.1.2 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.1.1 app/controllers/locomotive/my_account_controller.rb
locomotive_cms-2.1.0 app/controllers/locomotive/my_account_controller.rb