Sha256: 43465453c0b6a01785691905c9820fdb614f857fa825b585d3488b0a6f8ccada

Contents?: true

Size: 789 Bytes

Versions: 11

Compression:

Stored size: 789 Bytes

Contents

class UcbRails::UsersDatatable < UcbRails::BaseDatatable

  private

  def default_scope
    UcbRails::User
  end
  
  def column_names
    @column_names ||= %w[admin inactive first_name last_name email phone last_request_at uid]
  end
  
  def search(search_term)
    ["first_name like :search or last_name like :search", search: "#{search_term}%"]
  end
  
  def record_to_data(user)
    [
      bln(user.admin),
      bln(user.inactive),
      h(user.first_name),
      h(user.last_name),
      h(user.email),
      h(user.phone),
      h(user.last_request_at),
      h(user.uid),
      link_to("Edit", edit_ucb_rails_admin_user_path(user), :id => dom_id(user)),
      link_to('Delete', ucb_rails_admin_user_path(user), :method => :delete, :confirm => 'Are you sure?'),
    ]
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ucb_rails-0.0.13 app/datatables/ucb_rails/users_datatable.rb
ucb_rails-0.0.12 app/datatables/ucb_rails/users_datatable.rb
ucb_rails-0.0.11 app/datatables/ucb_rails/users_datatable.rb
ucb_rails-0.0.10 app/datatables/ucb_rails/users_datatable.rb
ucb_rails-0.0.9 app/datatables/ucb_rails/users_datatable.rb
ucb_rails-0.0.8 app/datatables/ucb_rails/users_datatable.rb
ucb_rails-0.0.7 app/datatables/ucb_rails/users_datatable.rb
ucb_rails-0.0.6 app/datatables/ucb_rails/users_datatable.rb
ucb_rails-0.0.5 app/datatables/ucb_rails/users_datatable.rb
ucb_rails-0.0.4 app/datatables/ucb_rails/users_datatable.rb
ucb_rails-0.0.3 app/datatables/ucb_rails/users_datatable.rb