This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Client | |
include DataMapper::Resource | |
property :id, Integer, :serial => true | |
property :name, String | |
property :email, String | |
property :city, String, :lazy => true | |
property :zip_code, String, :field => 'postal_code', :lazy => true | |
property :phone, String, :lazy => true | |
property :address, String, :lazy => true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem dep -r merb-core | |
Gem merb-core-0.9.6 | |
extlib (= 0.9.6, runtime) | |
erubis (>= 0, runtime) | |
rake (>= 0, runtime) | |
json_pure (>= 0, runtime) | |
rspec (>= 0, runtime) | |
rack (>= 0, runtime) | |
mime-types (>= 0, runtime) | |
hpricot (>= 0, runtime) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merb awesome Router | |
Reuse your code: Merb Slices | |
How to test a Merb App the Merb way | |
Merb Auth: rethink authentication | |
How to contribute to Merb | |
How to deploy a Merb App | |
DataMapper, the Ruby ORM that kicks butt and takes names | |
CouchDB and multiple DBs with Merb+DM | |
Sequel: The Database Toolkit for Ruby | |
jQuery & Merb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
$('.delete').livequery('click', function() { | |
return confirm('Are you sure?'); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# == Schema Information | |
# Schema version: 16 | |
# | |
# Table name: users | |
# | |
# id :integer(11) not null, primary key | |
# name :string(255) | |
# login :string(255) | |
# email :string(255) | |
# admin :boolean(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# controller: sleep(0.1) | |
# mutex off | |
$ ab -n 2000 -c 10 http://0.0.0.0:4000/ | |
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0 | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Copyright 2006 The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 0.0.0.0 (be patient) | |
Completed 200 requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1var e=Error,aa=Boolean,ba=undefined,ca=encodeURIComponent,da=parseInt,ea=String,i=window,fa=Number,ga=Object,j=document,ha=decodeURIComponent,m=Math;function ia(a,b){return a.toString=b}function ja(a,b){return a.length=b}function ka(a,b){return a.title=b}function la(a,b){return a.position=b}function ma(a,b){return a.selectedIndex=b}function o(a,b){return a.className=b}function na(a,b){return a.width=b}function oa(a,b){return a.plindex=b}function p(a,b){return a.innerHTML=b}function pa(a,b){return a.value= | |
2b}function qa(a,b){return a.disabled=b}function ra(a,b){return a.currentTarget=b}function sa(a,b){return a.view=b}function ta(a,b){return a.target=b}function ua(a,b){return a.screenX=b}function va(a,b){return a.screenY=b}function wa(a,b){return a.keyCode=b}function xa(a,b){return a.marginTop=b}function ya(a,b){return a.docid=b}function za(a,b){return a.href=b}function Ba(a,b){return a.type=b}function Ca(a,b){return a.esrc=b}function r(a,b){return a.display=b}function s(a,b){return a.height=b}function Da |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Merb | |
module GlobalHelpers | |
@@formats ={ | |
:US => { | |
:number => { | |
:precision => 3, | |
:delimiter => ',', | |
:separator => '.' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Numeric | |
module Transformer | |
@formats ={ | |
:US => { | |
:number => { | |
:precision => 3, | |
:delimiter => ',', | |
:separator => '.' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "should be able to add a format" do | |
merb_format = {:merb => | |
{ :number => { | |
:precision => 3, | |
:delimiter => ' ', | |
:separator => ',' | |
}, | |
:currency => { | |
:unit => 'Merbollars', | |
:format => '%n %u', |