Skip to content

Instantly share code, notes, and snippets.

@zh
Forked from nesquena/my_template.rb
Created January 18, 2012 09:30
Show Gist options
  • Select an option

  • Save zh/1632148 to your computer and use it in GitHub Desktop.

Select an option

Save zh/1632148 to your computer and use it in GitHub Desktop.
project :test => :rspec, :orm => :activerecord, :script => :jquery, :renderer => :erb
# admin interface
generate :admin
rake "ar:create ar:migrate"
rake :seed
git :init
git :add, "."
git :commit, "initial commit - admin interface"
# post model
generate :model, "post title:string body:text --a app"
inject_into_file "db/migrate/002_create_posts.rb","t.timestamps", :after => "t.text :body¥n"
rake "ar:migrate"
# posts controller
generate :controller, "posts get:index get:show"
# posts admin page
generate "admin_page post"
git :init
git :add, "."
git :commit, "Post model and admin page added"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment