Class: ActionDispatch::Routing::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/wash_out.rb

Instance Method Summary collapse

Instance Method Details

#wash_out(controller_name, options = {}) ⇒ Object

Adds the routes for a SOAP endpoint at controller.



13
14
15
16
17
18
19
# File 'lib/wash_out.rb', line 13

def wash_out(controller_name, options={})
  options.reverse_merge!(@scope) if @scope
  controller_class_name = [options[:module], controller_name].compact.join("/")

  match "#{controller_name}/wsdl"   => "#{controller_name}#_generate_wsdl", :via => :get, :format => false
  match "#{controller_name}/action" => WashOut::Router.new(controller_class_name), :defaults => { :controller => controller_class_name, :action => '_action' }, :format => false
end