- Single Responsibity Principle (SRP).
- Skinny Controller, Fat Model.
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 'nokogiri' |
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
=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') |
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
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed | |
/home/zzak/.rvm/gems/ruby-1.9.3-p0@whatever/gems/net-http-persistent-2.3.3/lib/net/http/persistent/ssl_reuse.rb:70:in `connect' | |
/home/zzak/.rvm/gems/ruby-1.9.3-p0@whatever/gems/net-http-persistent-2.3.3/lib/net/http/persistent/ssl_reuse.rb:70:in `block in connect' | |
/home/zzak/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:54:in `timeout' | |
/home/zzak/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:99:in `timeout' | |
/home/zzak/.rvm/gems/ruby-1.9.3-p0@whatever/gems/net-http-persistent-2.3.3/lib/net/http/persistent/ssl_reuse.rb:70:in `connect' | |
/home/zzak/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:755:in `do_start' | |
/home/zzak/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:750:in `start' | |
/home/zzak/.rvm/gems/ruby-1.9.3-p0@whatever/gems/net-http-persistent-2.3.3/lib/net/http/persistent.rb:405:in `connection_for' | |
/home/zzak/.rvm/gems/ruby-1.9. |
This guide is for a first-time Rails developer to deploy their app to Heroku, a popular web-hosting service with strong Rails support. This guide assumes you already have a Heroku account and have installed the Heroku Toolbelt.
- Make sure you've setup an SSH key for Heroku. Follow this simple guide to create an SSH key and send it to Heroku if needed: Heroku: Managing Your SSH Keys
- Navigate into the folder for your Rails app.
This is an example or boilerplate layout file. Your layout file is the frame rendered around every view in your app (via the <%= yield %>
erb tag at the bottom). Every Rails app has a layout file at app/views/layouts/application.html.erb
.
This layout file includes:
These steps are for Mavericks. Mileage will vary for older versions of Mac OS X but the broad strokes still apply. Google is your friend if you hit a snag. Comments welcome.
Install homebrew.
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
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
require 'active_support/core_ext/hash/keys' | |
class Hash | |
def recursively_symbolize_keys! | |
self.symbolize_keys! | |
self.values.each do |v| | |
if v.is_a? Hash | |
v.recursively_symbolize_keys! | |
elsif v.is_a? Array | |
v.recursively_symbolize_keys! |
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
require 'pry' | |
After( '@developing' ) do |scenario| | |
binding.pry if scenario.failed? | |
end |
OlderNewer