Skip to content

Instantly share code, notes, and snippets.

View mr-showbiz's full-sized avatar

Chris Ramsden mr-showbiz

View GitHub Profile
@eliotsykes
eliotsykes / Gemfile
Last active August 28, 2019 02:56
JavaScript testing in Rails 4.x with RSpec, Capybara, PhantomJS, Poltergeist
# Add poltergeist gem to Gemfile, in :test group,
# then run `bundle` to install
group :test do
...
gem 'poltergeist'
...
end
@lfender6445
lfender6445 / gist:9919357
Last active March 6, 2026 09:32
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@slamotte
slamotte / shallow_nested_routes.rb
Last active March 21, 2018 12:06
Allows ActiveResource to be used with shallow nested routes.
module ShallowNestedRoutes
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
# Pass in the name of the parent class
def set_shallow_nested_route_parent(parent)
parent = parent.to_s
# Override these methods so they set the prefix path before a call and reset it afterward.