See documentation here
def example | |
puts 'using gistify' | |
end |
#HTTP and REST
- Whenever you navigate a site though links, you're making a state transition, bringing you to the next page. Representing the next state of the application.
- In order for a client and a server to speak to each other, they follow a set of principles called REST (Representational State Transer).
require 'active_support/core_ext/array' | |
class Garden | |
attr_reader :layout, :for_student, :students | |
def initialize(layout, students = Garden.default_students) | |
@students = students | |
@layout = parse(layout) | |
@for_student = group_by_student | |
define_student_lookups |
body { | |
width: 100%; | |
height: 500px; | |
margin: 0; | |
padding: 0; | |
text-align: center; | |
} | |
body:before { | |
display: inline-block; | |
content: ' '; |
What this guide will cover: the code you will need in order to include Redis and Resque in your Rails app, and the process of creating a background job with Resque.
What this guide will not cover: installing Ruby, Rails, or Redis.
Note: As of this writing I am still using Ruby 1.9.3p374, Rails 3.2.13, Redis 2.6.11, and Resque 1.24.1. I use SQLite in development and Postgres in production.
Background jobs are frustrating if you've never dealt with them before. Over the past few weeks I've had to incorporate Redis and Resque into my projects in various ways and every bit of progress I made was very painful. There are many 'gotchas' when it comes to background workers, and documentation tends to be outdated or scattered at best.
##Vagrant and Environment setup
Under VirtualBox platform packages, install the package for your OS
- download the latest version of vagrant at http://downloads.vagrantup.com/ and install it.
# in spec/support/omniauth_macros.rb | |
module OmniauthMacros | |
def mock_auth_hash | |
# The mock_auth configuration allows you to set per-provider (or default) | |
# authentication hashes to return during integration testing. | |
OmniAuth.config.mock_auth[:twitter] = { | |
'provider' => 'twitter', | |
'uid' => '123545', | |
'user_info' => { | |
'name' => 'mockuser', |