Created
May 23, 2014 23:57
-
-
Save uguisu-an/9e2bf60128b79849381a to your computer and use it in GitHub Desktop.
rails template for devise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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