Skip to content

Instantly share code, notes, and snippets.

@wrburgess
Created April 1, 2012 18:39
Show Gist options
  • Select an option

  • Save wrburgess/2277606 to your computer and use it in GitHub Desktop.

Select an option

Save wrburgess/2277606 to your computer and use it in GitHub Desktop.
Bootstrap: Rails App with ActiveAdmin on Heroku

##Get the files

###Download or clone the rails-aa-heroku-bootstrap repo on Github

###Set up terminal command to clone bootstrap:

git clone git://github.com/wrburgess/rails-aa-heroku-bootstrap.git [app-name]
terminal command to switch to app dir:
cd [app-name]
terminal command:
git remote set-url origin [new-github-repo-url]

##Change from RailsApp to your App Name in these files (if necessary):

config/environments/test.rb
config/environments/development.rb
config/environments/production.rb
config/initializers/secret_token.rb
config/initializers/session_store.rb
config/application.rb
config/routes.rb
config.ru
Rakefile
app/views/layouts/application.html.erb, in title tag

##Ensure Gems are installed terminal command:

bundle install

##Test the local install terminal command:

rake db:migrate
terminal command:
rails s
browser url:
http://localhost:3000/admin
admin credentials:
un: admin@example.com, pw: password

##Customize a few settings go to config/environments/production.rb and add this line:

config.action_mailer.default_url_options = { :host => '[domain.of.site.com]' }

##Create the Heroku Dev Site terminal command for heroku app creation:

heroku create --stack cedar --remote dev
terminal command for heroku app renaming:
heroku rename [app-name]-dev --remote dev
terminal command AdminUser emails:
heroku addons:add sendgrid:starter --remote dev
terminal command for Initial Heroku Migration:
heroku run rake db:setup --remote dev
terminal command for Heroku Migrations:
heroku run rake db:migrate --remote dev

##Create the Heroku Prod Site terminal command for heroku app creation:

heroku create --stack cedar --remote prod
terminal command for heroku app renaming:
heroku rename [app-name]-dev --remote prod
terminal command AdminUser emails:
heroku addons:add sendgrid:starter --remote prod
terminal command for Initial Heroku Migration:
heroku run rake db:setup --remote prod
terminal command for Heroku Migrations:
heroku run rake db:migrate --remote prod

##Change the Admin username/password visit this path and change admin email address:

/admin/admin_users/1/edit

##Change the Email Setting in Devise

  • change the config.mailer_sender in config / initializer / devise.rb

##Change the ActiveAdmin settings

  • go to config/initializers/active_admin.rb for basic settings
  • go to app/admin/dashboards.rb for the dashboard

##Adjust for the mass assignment security changes

Make this edit to your respective model files at /app/models/model_name.rb :

class User < ActiveRecord::Base
  attr_accessible :firstname, :lastname, :age

end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment