Module: Amnesia::Routes
- Included in:
- Application
- Defined in:
- lib/amnesia/routes.rb
Class Method Summary collapse
Class Method Details
.included(app) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/amnesia/routes.rb', line 3 def self.included app app.class_eval do get '/' do haml :index end get '/:address' do @host = find_host params[:address] @host ? haml(:host) : halt(404) end def find_host address @hosts.find { |h| h.address == address } end end end |