Sha256: 4c7c50925edf3430fdbf051b625570322dc8ad9c866077b42c7f50acd2354971

Contents?: true

Size: 981 Bytes

Versions: 4

Compression:

Stored size: 981 Bytes

Contents

class Admin::UsersController < Admin::BaseController
  load_and_authorize_resource

  def activate
    resource.activate!
    redirect_to :back
  end

  def suspend
    resource.suspend!
    redirect_to :back
  end

  private

  export do
    field :login
    field :email
    field :first_name
    field :last_name
    field :patronymic
    field(:trust_state) {|r| r.trust_state_type.try(:title) }
    field(:user_role_id) {|r| r.user_role_type.try(:title) }
    field :phone
    field :skype
    field :birthday
    field :locale
    field :time_zone
    #field(:gender) {|r| r.gender_type.try(:title) }
    field :sign_in_count
    field :current_sign_in_at
    field :last_sign_in_at
    field :current_sign_in_ip
    field :last_sign_in_ip
    field :confirmed_at
    field :created_at
  end

  def resource_action_items
    [:edit, :destroy, :show, :preview, :activate, :suspend]
  end

  def build_resource
    super
    resource.skip_confirmation!
    resource
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ab_admin-0.6.1 app/controllers/admin/users_controller.rb
ab_admin-0.6.0 app/controllers/admin/users_controller.rb
ab_admin-0.5.0 app/controllers/admin/users_controller.rb
ab_admin-0.4.0 app/controllers/admin/users_controller.rb