Skip to content

Instantly share code, notes, and snippets.

View DouweM's full-sized avatar

Douwe Maan DouweM

View GitHub Profile
anonymous
anonymous / gist:7290501
Created November 3, 2013 13:56
class TestClass < BasicObject
end
new_object = TestClass.new
"hello".eql? new_object
=> false
"hello" == new_object
NoMethodError: undefined method `respond_to?' for #<TestClass:0x7ea920>
@traviskroberts
traviskroberts / cleaner_routes.rb
Last active October 3, 2015 17:58 — forked from dhh/gist:2492118
Route Organization
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}_routes.rb")))
end
end
BCX::Application.routes.draw do
draw :admin
draw :frontend
draw :resources
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session