Sha256: f3bba260ca5ade679cac377f4ad32b0998a93c03ab2e1fcbf5b538d13ba8ee6b
Contents?: true
Size: 821 Bytes
Versions: 26
Compression:
Stored size: 821 Bytes
Contents
module Binders class Users < Bowline::Binders::Collection class << self # self.items is a special method # Basically it'll update users on the client side def index self.items = User.all end def admins self.items = User.admins.all end end def update(attrs) if @item.update_attributes(attrs) flash[:notice] = "Successfully updated" else flash[:notice] = "Errors updating users" end end def highlight # Calls $('user_1').highlight() self.element.highlight end # Overrides charge on user def charge! # calls charge! on model (i.e. do sql commit ) self.item.charge! # Now gui stuff flash[:notice] = "Successfully charged" highlight end end end
Version data entries
26 entries across 26 versions & 2 rubygems