Install the Rails gem if you haven't done so before
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
| # overwrite master with contents of feature branch (feature > master) | |
| git checkout feature # source name | |
| git merge -s ours master # target name | |
| git checkout master # target name | |
| git merge feature # source name |
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 "active_link_to" | |
| gem "activerecord-import" | |
| gem "bootsnap", ">= 1.4.2", require: false | |
| gem "csv" # Use to write to CSV | |
| gem "dotenv-rails" | |
| gem "devise" | |
| gem "excon" | |
| gem "flutie" | |
| gem "friendly_id" | |
| gem "fog" |
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
| font-family: Arial, Helvetica, sans-serif; | |
| font-family: 'Arial Black', Gadget, sans-serif; | |
| font-family: 'Bookman Old Style', serif; | |
| font-family: 'Comic Sans MS', cursive; | |
| font-family: Courier, monospace; | |
| font-family: 'Courier New', Courier, monospace; | |
| font-family: Garamond, serif; | |
| font-family: Georgia, serif; | |
| font-family: Impact, Charcoal, sans-serif; | |
| font-family: 'Lucida Console', Monaco, monospace; |
Many programming languages, including Ruby, have native boolean (true and false) data types. In Ruby they're called true and false. In Python, for example, they're written as True and False. But oftentimes we want to use a non-boolean value (integers, strings, arrays, etc.) in a boolean context (if statement, &&, ||, etc.).
This outlines how this works in Ruby, with some basic examples from Python and JavaScript, too. The idea is much more general than any of these specific languages, though. It's really a question of how the people designing a programming language wants booleans and conditionals to work.
If you want to use or share this material, please see the license file, below.
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
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
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
| # Rake task to launch multiple Resque workers in development/production with simple management included | |
| require 'resque/tasks' # Require Resque tasks | |
| namespace :workers do | |
| # = $ rake workers:start | |
| # | |
| # Launch multiple Resque workers with the Rails environment loaded, | |
| # so they have access to your models, etc. |
NewerOlder
