Skip to content

Instantly share code, notes, and snippets.

@saikiranmothe
Last active December 21, 2015 01:38
Show Gist options
  • Save saikiranmothe/6228873 to your computer and use it in GitHub Desktop.
Save saikiranmothe/6228873 to your computer and use it in GitHub Desktop.
blog_temaplte - rails application template
run "rm public/index.html"
add_source "https://rubygems.org"
require 'rbconfig'
require 'open-uri'
require 'net/http'
gsub_file 'Gemfile', "gem 'jquery-rails'", "gem 'jquery-rails', '~> 2.0'"
gem 'devise'
gem 'activeadmin'
gem 'sass-rails', '~> 3.2.3', :group => :assets
gem 'coffee-rails', '~> 3.2.1', :group => :assets
gem 'uglifier', '>= 1.0.3', :group => :assets
gem 'jquery-rails' ,'~> 2.0', :group => :assets
gem 'therubyracer', :platforms => :ruby ,:group => :assets
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
gem "twitter-bootstrap-rails"
#gsub_file 'Gemfile', /#.*\n/, "\n"
run 'bundle install'
rake "db:create"
#Running Spree Generator Commands
generate 'bootstrap:install'
if yes?("Do you want to create bootstrap layout (Yes/No)?")
generate 'bootstrap:layout application fluid'
end
generate 'devise:install'
generate 'devise user'
generate 'active_admin:install'
append_file 'db/seeds.rb' do <<-'FILE'
AdminUser.create! :email => '[email protected]',:password => "adminadmin"
FILE
end
run "rm public/index.html"
generate(:scaffold, "post name:string content:string")
rake("db:migrate")
rake "db:migrate"
rake "db:seed"
generate 'active_admin:resource user'
generate 'active_admin:resource post'
rake "db:migrate"
git :init
git :add => "."
git :commit => "-a -m 'Initial commit'"
say <<-eos
################################################################
Your new Blog application is ready to go.
run rails s
Now login to admin interface by
localhost:3000/admin
login:[email protected]
password: password
#################################################################
eos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment