Skip to content

Instantly share code, notes, and snippets.

@uguisu-an
Created May 23, 2014 23:57
Show Gist options
  • Save uguisu-an/9e2bf60128b79849381a to your computer and use it in GitHub Desktop.
Save uguisu-an/9e2bf60128b79849381a to your computer and use it in GitHub Desktop.
rails template for devise
gem 'devise'
run_bundle
generate 'devise:install'
generate 'devise:views'
application <<-CODE, env: 'development'
config.action_mailer.default_url_options = { host: 'localhost:3000' }
CODE
file 'app/views/layouts/_notification.html.erb', <<-CODE
<% if notice %>
<p class="alert alert-success"><%= notice %></p>
<% end %>
<% if alert %>
<p class="alert alert-danger"><%= alert %></p>
<% end %>
CODE
gsub_file 'app/views/layouts/application.html.erb', /^\s*<%= yield %>/, <<-CODE
<div class="container">
<%= render 'layouts/notification' %>
<%= yield %>
</div>
CODE
# generate 'devise', 'user'
# rake 'db:migrate'
git :add => "--all"
git :commit => "-qm 'Install Devise'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment