start new:
tmux
start new with session name:
tmux new -s myname
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| $(function(){ | |
| railsMonthDates(); | |
| $("select[id*=_2i], select[id*=_1i]").change( railsMonthDates ); | |
| }); | |
| function railsMonthDates() { | |
| $("select[id*=_2i]").each(function(){ | |
| $monthSelect = $(this); | |
| $daySelect = $(this).siblings("select[id*=_3i]"); | |
| $yearSelect = $(this).siblings("select[id*=_1i]"); |
| # Support for Rspec / Capybara subdomain integration testing | |
| # Make sure this file is required by spec_helper.rb | |
| # (e.g. save as spec/support/subdomains.rb) | |
| def switch_to_subdomain(subdomain) | |
| # lvh.me always resolves to 127.0.0.1 | |
| hostname = subdomain ? "#{subdomain}.lvh.me" : "lvh.me" | |
| Capybara.app_host = "http://#{hostname}" | |
| end |
Press minus + shift + s and return to chop/fold long lines!
| # app/controllers/sessions_controller.rb | |
| class SessionsController < Devise::SessionsController | |
| # This controller provides a JSON version of the Devise::SessionsController and | |
| # is compatible with the use of SimpleTokenAuthentication. | |
| # See https://github.com/gonzalo-bulnes/simple_token_authentication/issues/27 | |
| def create | |
| # Fetch params |
The purpose of design is to allow you to do design later, and it's primary goal is to reduce the cost of change.
#Simple Authentication with Bcrypt
This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.
The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).
You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault
##Steps