text
(String, Regexp)
— Only find elements which contain this text or match this regexpvisible
(Boolean, Symbol)
— Only find elements with the specified visibility:true
- only finds visible elements.false
- finds invisible and visible elements.:all
- same asfalse
; finds visible and invisible elements.:hidden
- only finds invisible elements.:visible
- same astrue
; only finds visible elements.
count
(Integer)
— Exact number of matches that are expected to be found
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
source 'https://rubygems.org' | |
def ruby_version | |
version_file = ".ruby-version" | |
version_override = (File.exist?(version_file) && File.read(version_file).strip) | |
default_version = "2.1.5" | |
version_override || default_version | |
end | |
ruby ruby_version |
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
(function() { | |
var CSRFToken, Click, ComponentUrl, EVENTS, Link, browserCompatibleDocumentParser, browserIsntBuggy, browserSupportsCustomEvents, browserSupportsPushState, browserSupportsTurbolinks, bypassOnLoadPopstate, cacheCurrentPage, cacheSize, changePage, clone, constrainPageCacheTo, createDocument, currentState, enableTransitionCache, executeScriptTags, extractTitleAndBody, fetch, fetchHistory, fetchReplacement, historyStateIsDefined, initializeTurbolinks, installDocumentReadyPageEventTriggers, installHistoryChangeHandler, installJqueryAjaxSuccessPageUpdateTrigger, loadedAssets, manuallyTriggerHashChangeForFirefox, pageCache, pageChangePrevented, pagesCached, popCookie, processResponse, recallScrollPosition, referer, reflectNewUrl, reflectRedirectedUrl, rememberCurrentState, rememberCurrentUrl, rememberReferer, removeNoscriptTags, requestMethodIsSafe, resetScrollPosition, setAutofocusElement, transitionCacheEnabled, transitionCacheFor, triggerEvent, visit, xhr, _ref, | |
__indexOf = [].indexOf || funct |
SSH to the vagrant OS command line.
Terminal $> vagrant ssh
Login to postgres database as vagrant user with the psql client:
vagrant@rails-dev-box: psql -U vagrant postgres
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 'rails_helper' | |
RSpec.describe TodosController, :type => :controller do | |
describe "GET #index" do | |
#describe "POST #create" do | |
#describe "GET #show" do | |
#describe "PATCH #update" do (or PUT #update) | |
#describe "DELETE #destroy" do | |
#describe "GET #new" do |
Triple backticks are used to open and close code blocks. The triple backticks need to be on their own line:
puts "hello world"
And here is another, separate code block. Triple backticks open and close it:
puts "line 1"
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
# Add poltergeist gem to Gemfile, in :test group, | |
# then run `bundle` to install | |
group :test do | |
... | |
gem 'poltergeist' | |
... | |
end |
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
# 1. Add rack-rewrite to your Gemfile and run 'bundle install': | |
# gem 'rack-rewrite' | |
# | |
# 2. Create a file with the contents below in config/initializers/asset_server_middleware.rb | |
# | |
# 3. Rename 'YourApp' below | |
# | |
# 4. In config/environments/production.rb and config/environments/test.rb, set: | |
# config.serve_static_assets = true | |
# config.assets.compile = false |
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
<%# Shows a map centred on London, using the default marker/pin image. %> | |
<%= gmaps4rails([{:lat => 51.51, :lng => -0.12}].to_json) %> | |
<%= yield :scripts %><%# Usually yield :scripts goes just before the closing body tag %> |