Sha256: 80b940c2d161786428ea0fa655c20ae490b8f993b985b53f9a909b6b6890cb91

Contents?: true

Size: 640 Bytes

Versions: 13

Compression:

Stored size: 640 Bytes

Contents

module Binders
  class Users < Bowline::Binders::Base
    bind User    
    class << self 
      def admins
        self.items = User.admins.all
      end
    end
  
    def update(attrs)
      if @item.update_attributes(attrs)
        page.flash("Successfully updated").call
      else
        page.flash_error("Errors updating users").call
      end
    end
 
    def highlight
      # Calls $('user_1').highlight()
      self.element.highlight.call
    end
  
    def charge!
      # calls charge! on model (i.e. do SQL commit )
      self.item.charge!
      # Now gui stuff
      page.flash("Charged!")
      highlight
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
bowline-0.9.4 examples/users.rb
bowline-0.9.3 examples/users.rb
bowline-0.9.2 examples/users.rb
bowline-0.9.1 examples/users.rb
bowline-0.6.3 examples/users.rb
bowline-0.6.2 examples/users.rb
bowline-0.6.1 examples/users.rb
bowline-0.6.0 examples/users.rb
bowline-0.5.8 examples/users.rb
bowline-0.5.7 examples/users.rb
bowline-0.5.6 examples/users.rb
bowline-0.5.5 examples/users.rb
bowline-0.5.4 examples/users.rb