Module: RailsMini::Ext::RouterMappings

Defined in:
lib/rails_mini/ext.rb

Instance Method Summary collapse

Instance Method Details

#configObject



3
4
5
# File 'lib/rails_mini/ext.rb', line 3

def config
  RailsMini::App.config
end

#match(path, options = nil, &blk) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rails_mini/ext.rb', line 7

def match(path,options=nil,&blk)
  if blk
    options ||= {}

    controller = Class.new(ActionController::Base)

    controller.send(:define_method,path.to_sym,blk)

    options[:to] ||= controller.action(path.to_sym)
  end
  super(path,options)
end