Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. To use Bcrypt:
  2. uncomment "gem 'bcrypt', '~> 3.1.7'" in Gemfile
  3. User model should have password_digest attribute
  4. add "has_secure_password" to User
  5. add "validates_confirmation_of :password" to User (if you have password confirmation which you should!)
  6.  
  7. To display flash messages:
  8. add the following to views/layouts/application.html.erb right before yield line:
  9. <% flash.each do |key, value| %>
  10. <div class="alert -<%= key %>">
  11. <%= value %>
  12. </div>
  13. <% end %>
  14.  
  15. To use RSpec with Capybara:
  16. add gem 'rspec-rails' and gem 'capybara' to Gemfile
  17. in rails_helper.rb: require 'capybara/rails' and add "config.include Capybara::DSL" to config block
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement