Skip to content

Instantly share code, notes, and snippets.

@woodie
Created January 3, 2010 23:32

Revisions

  1. woodie revised this gist Sep 5, 2010. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    =Rails 2.3.9 on App Engine (DataMapper)
    =Rails 2.3.5 on App Engine (DataMapper)

    Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

    @@ -11,19 +11,19 @@ See the TInyDS version also: http://gist.github.com/gists/269075
    One meta-gem provides the development environment
    sudo gem install google-appengine

    ==Install Rails 2.3.9 with required patches
    ==Install Rails 2.3.5 with required patches

    Install some gems you'll need
    sudo gem install rails -v "2.3.9"
    sudo gem install rails -v "2.3.5"
    sudo gem install rails_dm_datastore
    sudo gem install activerecord-nulldb-adapter

    Create a folder for your app
    mkdir rails_app; cd rails_app

    Download and run the setup script
    curl -O http://appengine-jruby.googlecode.com/hg/demos/rails2/rails239_appengine.rb
    ruby rails239_appengine.rb
    curl -O http://appengine-jruby.googlecode.com/hg/demos/rails2/rails235_appengine.rb
    ruby rails235_appengine.rb

    ==Working with Your Rails App

  2. woodie revised this gist Sep 5, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.rdoc
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ Create a folder for your app
    mkdir rails_app; cd rails_app

    Download and run the setup script
    curl -O http://appengine-jruby.googlecode.com/hg/demos/rails2/rails238_appengine.rb
    curl -O http://appengine-jruby.googlecode.com/hg/demos/rails2/rails239_appengine.rb
    ruby rails239_appengine.rb

    ==Working with Your Rails App
  3. woodie revised this gist Sep 5, 2010. 2 changed files with 64 additions and 0 deletions.
    51 changes: 51 additions & 0 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -1 +1,52 @@
    =Rails 2.3.9 on App Engine (DataMapper)

    Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

    We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.x calls to rubygems, and now we have it working. Rails 2.3.x currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

    See the TInyDS version also: http://gist.github.com/gists/269075

    ==Install the Development Environment

    One meta-gem provides the development environment
    sudo gem install google-appengine

    ==Install Rails 2.3.9 with required patches

    Install some gems you'll need
    sudo gem install rails -v "2.3.9"
    sudo gem install rails_dm_datastore
    sudo gem install activerecord-nulldb-adapter

    Create a folder for your app
    mkdir rails_app; cd rails_app

    Download and run the setup script
    curl -O http://appengine-jruby.googlecode.com/hg/demos/rails2/rails238_appengine.rb
    ruby rails239_appengine.rb

    ==Working with Your Rails App

    Start development server
    ./script/server.sh

    Open local console
    ./script/console.sh

    Publish to production
    ./script/publish.sh

    ==Support for generators

    We disable rubygems in the development environment, and the generators from Rails 2 perform various Gem dependency checks that are too difficult to patch, so we run the generators from the MRI. We also use Josh Moore's rails_dm_datastore integration plugin.

    Generate a restful controller and add it to config/routes.rb
    ./script/generate scaffold contact title:string summary:text \
    birthday:date url:string address:string phone:string -f --skip-migration

    Generate a model for DataMapper

    ./script/generate dd_model contact title:string summary:text \
    birthday:date url:link address:postal_address phone:phone_number -f

    You’ve created a RESTful controller, and a DataMapper model
    13 changes: 13 additions & 0 deletions contact.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    class Contact
    include DataMapper::Resource
    storage_names[:default] = "Contact"

    property :id, Serial
    property :title, String, :required => true, :length => 500
    property :summary, Text, :required => true, :lazy => false
    property :birthday, Date, :required => true
    property :url, Link, :required => true
    property :address, PostalAddress, :required => true
    property :phone, PhoneNumber, :required => true
    timestamps :at
    end
  4. woodie revised this gist Sep 5, 2010. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -1,4 +1 @@
    =Rails 2.3.5 on App Engine (DataMapper)

    Please use the updated guide:
    http://gist.github.com/486250
    =Rails 2.3.9 on App Engine (DataMapper)
  5. woodie revised this gist Jul 22, 2010. 2 changed files with 2 additions and 60 deletions.
    50 changes: 2 additions & 48 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -1,50 +1,4 @@
    =Rails 2.3.5 on App Engine (DataMapper)

    Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

    We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.5 calls to rubygems, and now we have it working. Rails 2.3.5 currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

    See the TinyDS version also: http://gist.github.com/269075

    ==Install the Development Environment

    The gems for the development environment include a pre-release appengine-tools gem that provides a pre-release version of jruby-rack.
    sudo gem install google-appengine

    ==Install Rails 2.3.5 with required patches

    Create a folder for your app
    mkdir rails_app; cd rails_app

    Download and run the setup script
    curl -O http://appengine-jruby.googlecode.com/hg/demos/rails2/rails2_appengine.rb
    ruby rails2_appengine.rb

    ==Working with Your Rails App

    Start development server
    ./script/server.sh

    Open local console
    ./script/console.sh

    Publish to production
    ./script/publish.sh

    ==Support for generators

    We disable rubygems in the development environment, and the generators from Rails 2 perform various Gem dependency checks that are too difficult to patch, so we run the generators from the MRI. We also use Josh Moore's rails_dm_datastore integration plugin.
    sudo gem install rails -v "2.3.5"
    sudo gem install rails_dm_datastore
    sudo gem install activerecord-nulldb-adapter

    Generate a restful controller and add it to config/routes.rb
    ./script/generate scaffold contact title:string summary:text \
    birthday:date url:string address:string phone:string -f --skip-migration

    Generate a model for DataMapper

    ./script/generate dd_model contact title:string summary:text \
    birthday:date url:link address:postal_address phone:phone_number -f

    You’ve created a RESTful controller, and a DataMapper model
    Please use the updated guide:
    http://gist.github.com/486250
    12 changes: 0 additions & 12 deletions contact.rb
    Original file line number Diff line number Diff line change
    @@ -1,12 +0,0 @@
    class Contact
    include DataMapper::Resource

    property :id, Serial
    property :title, String, :required => true, :length => 500
    property :summary, Text, :required => true, :lazy => false
    property :birthday, Date, :required => true
    property :url, Link, :required => true
    property :address, PostalAddress, :required => true
    property :phone, PhoneNumber, :required => true
    timestamps :at
    end
  6. woodie revised this gist May 22, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.rdoc
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    =Rails 2.3.5 on App Engine (DataMapper)

    Do not use rvm (or install and run from JRuby). The google-appengine gem must install into MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.
    Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

    We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.5 calls to rubygems, and now we have it working. Rails 2.3.5 currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

  7. woodie revised this gist May 22, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.rdoc
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    =Rails 2.3.5 on App Engine (DataMapper)

    Do not use rvm (or install and run from JRuby). The google-appengine gem must install into MRI. The appengine-sdk gem includes a complete java app server. We bootstrap java from MRI, then your app runs inside a servlet container using the version of JRuby installed into each app.
    Do not use rvm (or install and run from JRuby). The google-appengine gem must install into MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

    We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.5 calls to rubygems, and now we have it working. Rails 2.3.5 currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

  8. woodie revised this gist May 22, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.rdoc
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    =Rails 2.3.5 on App Engine (DataMapper)

    Do not use rvm (or install and run from JRuby). The google-appengine gem must install into MRI. The appengine-sdk gem includes a complete java app server, so we bootstrap java from MRI, then you app runs inside a servlet container using the version of JRuby installed into each app.
    Do not use rvm (or install and run from JRuby). The google-appengine gem must install into MRI. The appengine-sdk gem includes a complete java app server. We bootstrap java from MRI, then your app runs inside a servlet container using the version of JRuby installed into each app.

    We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.5 calls to rubygems, and now we have it working. Rails 2.3.5 currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

  9. woodie revised this gist May 22, 2010. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    =Rails 2.3.5 on App Engine (DataMapper)

    Do not use rvm (or install and run from JRuby). The google-appengine gem must install into MRI. The appengine-sdk gem includes a complete java app server, so we bootstrap java from MRI, then you app runs inside a servlet container using the version of JRuby installed into each app.

    We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.5 calls to rubygems, and now we have it working. Rails 2.3.5 currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

    See the TinyDS version also: http://gist.github.com/269075
  10. woodie renamed this gist May 6, 2010. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  11. woodie revised this gist Mar 2, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.rdoc
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ Open local console
    ./script/console.sh

    Publish to production
    ./script/console.sh
    ./script/publish.sh

    ==Support for generators

  12. woodie revised this gist Mar 2, 2010. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -21,13 +21,13 @@ Download and run the setup script
    ==Working with Your Rails App

    Start development server
    dev_appserver.rb .
    ./script/server.sh

    Open local console
    appcfg.rb run -S irb -r config/environment
    ./script/console.sh

    Publish to production
    appcfg.rb update .
    ./script/console.sh

    ==Support for generators

  13. woodie revised this gist Feb 12, 2010. 2 changed files with 9 additions and 8 deletions.
    4 changes: 2 additions & 2 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -38,11 +38,11 @@ We disable rubygems in the development environment, and the generators from Rail

    Generate a restful controller and add it to config/routes.rb
    ./script/generate scaffold contact title:string summary:text \
    url:string address:string phone:string -f --skip-migration
    birthday:date url:string address:string phone:string -f --skip-migration

    Generate a model for DataMapper

    ./script/generate dd_model contact title:string summary:text \
    url:link address:postal_address phone:phone_number -f
    birthday:date url:link address:postal_address phone:phone_number -f

    You’ve created a RESTful controller, and a DataMapper model
    13 changes: 7 additions & 6 deletions article.rb
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,12 @@
    class Contact
    include DataMapper::Resource

    property :id, Serial
    property :title, String, :required => true, :length => 500
    property :summary, Text, :required => true, :lazy => false
    property :url, Link, :required => true
    property :address, PostalAddress, :required => true
    property :phone, PhoneNumber, :required => true
    property :id, Serial
    property :title, String, :required => true, :length => 500
    property :summary, Text, :required => true, :lazy => false
    property :birthday, Date, :required => true
    property :url, Link, :required => true
    property :address, PostalAddress, :required => true
    property :phone, PhoneNumber, :required => true
    timestamps :at
    end
  14. woodie revised this gist Feb 12, 2010. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -32,8 +32,9 @@ Publish to production
    ==Support for generators

    We disable rubygems in the development environment, and the generators from Rails 2 perform various Gem dependency checks that are too difficult to patch, so we run the generators from the MRI. We also use Josh Moore's rails_dm_datastore integration plugin.
    sudo gem install rails rails_dm_datastore
    sudo gem install activerecord-nulldb-adapter
    sudo gem install rails -v "2.3.5"
    sudo gem install rails_dm_datastore
    sudo gem install activerecord-nulldb-adapter

    Generate a restful controller and add it to config/routes.rb
    ./script/generate scaffold contact title:string summary:text \
  15. woodie revised this gist Jan 27, 2010. 1 changed file with 0 additions and 4 deletions.
    4 changes: 0 additions & 4 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -18,10 +18,6 @@ Download and run the setup script
    curl -O http://appengine-jruby.googlecode.com/hg/demos/rails2/rails2_appengine.rb
    ruby rails2_appengine.rb

    Fix JRuby-Rack
    curl -sO http://jruby-primer.appspot.com/tools/fix008.rb
    ruby fix008.rb

    ==Working with Your Rails App

    Start development server
  16. woodie revised this gist Jan 25, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.rdoc
    Original file line number Diff line number Diff line change
    @@ -45,7 +45,7 @@ Generate a restful controller and add it to config/routes.rb

    Generate a model for DataMapper

    ./script/generate dm_model contact title:string summary:text \
    ./script/generate dd_model contact title:string summary:text \
    url:link address:postal_address phone:phone_number -f

    You’ve created a RESTful controller, and a DataMapper model
  17. woodie revised this gist Jan 22, 2010. 1 changed file with 3 additions and 4 deletions.
    7 changes: 3 additions & 4 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -18,10 +18,9 @@ Download and run the setup script
    curl -O http://appengine-jruby.googlecode.com/hg/demos/rails2/rails2_appengine.rb
    ruby rails2_appengine.rb

    Upgrade JRuby-Rack
    cd WEB-INF/lib
    curl -O http://appengine-jruby.googlecode.com/files/jruby-rack-0.9.6.jar
    cd ../..
    Fix JRuby-Rack
    curl -sO http://jruby-primer.appspot.com/tools/fix008.rb
    ruby fix008.rb

    ==Working with Your Rails App

  18. woodie revised this gist Jan 22, 2010. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -8,8 +8,6 @@ See the TinyDS version also: http://gist.github.com/269075

    The gems for the development environment include a pre-release appengine-tools gem that provides a pre-release version of jruby-rack.
    sudo gem install google-appengine
    sudo gem uninstall appengine-tools
    sudo gem install appengine-tools --pre

    ==Install Rails 2.3.5 with required patches

  19. woodie revised this gist Jan 22, 2010. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -20,6 +20,11 @@ Download and run the setup script
    curl -O http://appengine-jruby.googlecode.com/hg/demos/rails2/rails2_appengine.rb
    ruby rails2_appengine.rb

    Upgrade JRuby-Rack
    cd WEB-INF/lib
    curl -O http://appengine-jruby.googlecode.com/files/jruby-rack-0.9.6.jar
    cd ../..

    ==Working with Your Rails App

    Start development server
  20. woodie revised this gist Jan 17, 2010. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,8 @@ See the TinyDS version also: http://gist.github.com/269075

    The gems for the development environment include a pre-release appengine-tools gem that provides a pre-release version of jruby-rack.
    sudo gem install google-appengine
    sudo gem uninstall appengine-tools
    sudo gem install appengine-tools --pre

    ==Install Rails 2.3.5 with required patches

  21. woodie revised this gist Jan 15, 2010. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion README.rdoc
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,6 @@ See the TinyDS version also: http://gist.github.com/269075

    The gems for the development environment include a pre-release appengine-tools gem that provides a pre-release version of jruby-rack.
    sudo gem install google-appengine
    sudo gem install appengine-tools --pre

    ==Install Rails 2.3.5 with required patches

  22. woodie revised this gist Jan 13, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.rdoc
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,7 @@ Start development server
    dev_appserver.rb .

    Open local console
    appcfg.rb run script/console
    appcfg.rb run -S irb -r config/environment

    Publish to production
    appcfg.rb update .
  23. woodie revised this gist Jan 12, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion article.rb
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ class Contact
    include DataMapper::Resource

    property :id, Serial
    property :title, String, :required => true, :length => 250
    property :title, String, :required => true, :length => 500
    property :summary, Text, :required => true, :lazy => false
    property :url, Link, :required => true
    property :address, PostalAddress, :required => true
  24. woodie revised this gist Jan 12, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion article.rb
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ class Contact
    include DataMapper::Resource

    property :id, Serial
    property :title, String, :required => true, :length => 100
    property :title, String, :required => true, :length => 250
    property :summary, Text, :required => true, :lazy => false
    property :url, Link, :required => true
    property :address, PostalAddress, :required => true
  25. woodie revised this gist Jan 12, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion article.rb
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ class Contact
    property :title, String, :required => true, :length => 100
    property :summary, Text, :required => true, :lazy => false
    property :url, Link, :required => true
    property :address, PostalAddress, :nullable => false
    property :address, PostalAddress, :required => true
    property :phone, PhoneNumber, :required => true
    timestamps :at
    end
  26. woodie revised this gist Jan 12, 2010. 2 changed files with 6 additions and 5 deletions.
    8 changes: 4 additions & 4 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -37,12 +37,12 @@ We disable rubygems in the development environment, and the generators from Rail
    sudo gem install activerecord-nulldb-adapter

    Generate a restful controller and add it to config/routes.rb
    ./script/generate scaffold article title:string summary:text \
    url:string phone:string -f --skip-migration
    ./script/generate scaffold contact title:string summary:text \
    url:string address:string phone:string -f --skip-migration

    Generate a model for DataMapper

    ./script/generate dm_model article title:string summary:text \
    url:link phone:phone_number -f
    ./script/generate dm_model contact title:string summary:text \
    url:link address:postal_address phone:phone_number -f

    You’ve created a RESTful controller, and a DataMapper model
    3 changes: 2 additions & 1 deletion article.rb
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,11 @@
    class Article
    class Contact
    include DataMapper::Resource

    property :id, Serial
    property :title, String, :required => true, :length => 100
    property :summary, Text, :required => true, :lazy => false
    property :url, Link, :required => true
    property :address, PostalAddress, :nullable => false
    property :phone, PhoneNumber, :required => true
    timestamps :at
    end
  27. woodie revised this gist Jan 12, 2010. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions article.rb
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,9 @@ class Article
    include DataMapper::Resource

    property :id, Serial
    property :title, String, :nullable => false
    property :summary, Text, :nullable => false
    property :url, Link, :nullable => false
    property :phone, PhoneNumber, :nullable => false
    property :title, String, :required => true, :length => 100
    property :summary, Text, :required => true, :lazy => false
    property :url, Link, :required => true
    property :phone, PhoneNumber, :required => true
    timestamps :at
    end
  28. woodie revised this gist Jan 12, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.rdoc
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,7 @@ Publish to production

    ==Support for generators

    We disable rubygems in the development environment, and the generators from Rails 2 perform various Gem dependency checks that are too difficult to patch, so we run the generators from the MRI.
    We disable rubygems in the development environment, and the generators from Rails 2 perform various Gem dependency checks that are too difficult to patch, so we run the generators from the MRI. We also use Josh Moore's rails_dm_datastore integration plugin.
    sudo gem install rails rails_dm_datastore
    sudo gem install activerecord-nulldb-adapter

  29. woodie revised this gist Jan 12, 2010. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -45,6 +45,4 @@ Generate a model for DataMapper
    ./script/generate dm_model article title:string summary:text \
    url:link phone:phone_number -f

    ./script/generate dm_model article title:string summary:text url:string -f

    You’ve created a RESTful controller, and a DataMapper model
  30. woodie revised this gist Jan 12, 2010. 2 changed files with 7 additions and 3 deletions.
    7 changes: 5 additions & 2 deletions README.rdoc
    Original file line number Diff line number Diff line change
    @@ -37,11 +37,14 @@ We disable rubygems in the development environment, and the generators from Rail
    sudo gem install activerecord-nulldb-adapter

    Generate a restful controller and add it to config/routes.rb
    ./script/generate scaffold article title:string summary:text url:string \
    -f --skip-migration
    ./script/generate scaffold article title:string summary:text \
    url:string phone:string -f --skip-migration

    Generate a model for DataMapper

    ./script/generate dm_model article title:string summary:text \
    url:link phone:phone_number -f

    ./script/generate dm_model article title:string summary:text url:string -f

    You’ve created a RESTful controller, and a DataMapper model
    3 changes: 2 additions & 1 deletion app/models/article.rb → article.rb
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,7 @@ class Article
    property :id, Serial
    property :title, String, :nullable => false
    property :summary, Text, :nullable => false
    property :url, String, :nullable => false
    property :url, Link, :nullable => false
    property :phone, PhoneNumber, :nullable => false
    timestamps :at
    end