Sha256: ba43ff42586507374978f4521270bcbb6123af5eb3341671e848a5cc6cab6c6e

Contents?: true

Size: 745 Bytes

Versions: 26

Compression:

Stored size: 745 Bytes

Contents

module Binders
  class Account < Bowline::Binders::Singleton  
    class << self
      # self.collection is a special method
      # Basically it'll update users on the client side
      def index
        self.item = current_account
      end
 
      def destroy
        current_account.destroy
        self.item = nil
      end
    end
  
    # Everything has a js_id which is basically the lowercase classname + _ + self.id
    def highlight
      # Calls $(element).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

Version Path
maccman-bowline-0.1.10 examples/account.rb
maccman-bowline-0.1.6 examples/account.rb
maccman-bowline-0.1.7 examples/account.rb
maccman-bowline-0.1.8 examples/account.rb
maccman-bowline-0.3.0 examples/account.rb
maccman-bowline-0.3.1 examples/account.rb
maccman-bowline-0.3.3 examples/account.rb
maccman-bowline-0.3.5 examples/account.rb
maccman-bowline-0.3.6 examples/account.rb
maccman-bowline-0.3.7 examples/account.rb
maccman-bowline-0.3.9 examples/account.rb
maccman-bowline-0.4.0 examples/account.rb
maccman-bowline-0.4.1 examples/account.rb
maccman-bowline-0.4.3 examples/account.rb
maccman-bowline-0.4.4 examples/account.rb
maccman-bowline-0.4.5 examples/account.rb
maccman-bowline-0.4.6 examples/account.rb
maccman-bowline-0.4.7 examples/account.rb
maccman-bowline-0.4.8 examples/account.rb
bowline-0.5.3 examples/account.rb