Instantly share code, notes, and snippets.

What would you like to do?
A template to create a blog with hobo. Quickly!
# Creates a demo blog in a new hobo project
# Usage: rake rails:template LOCATION=template_demo_blog_hobo.rb
# Or: rake rails:template LOCATION=
say ("Installing gems so that we can scaffold...")
run 'bundle install'
generate 'hobo:setup_wizard' if yes? "Wanna run hobo:setup_wizard?"
generate 'hobo:resource', 'Post title:string text:text'
inject_into_class 'app/models/post.rb', 'Post' do
attr_accessible :title, :text
default_scope :order => 'created_at DESC'
validates :title, :presence => true,
:length => { :minimum => 5 }
route "root :to => 'posts#index'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment