Skip to content

Commit

Permalink
option to specify custom urls
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanRada committed Jan 20, 2014
1 parent c0101c6 commit 1d4d6e7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class WashoutBuilderController < ActionController::Base
class WashoutBuilder::WashoutBuilderController < ActionController::Base
protect_from_forgery

def all
Expand Down
5 changes: 5 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
WashoutBuilder::Engine.routes.draw do
root :to =>"washout_builder#all"


end
5 changes: 3 additions & 2 deletions lib/washout_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ class Mapper
# Adds the routes for a SOAP endpoint at +controller+.
def wash_out(controller_name, options={})
options.reverse_merge!(@scope) if @scope

match "#{controller_name}/doc" => "#{controller_name}#_generate_doc", :via => :get, :format => false

urldoc = options[:documentation_url].present? ? options[:documentation_url] : "doc"
match "#{controller_name}/#{urldoc}" => "#{controller_name}#_generate_doc", :via => :get, :format => false
original_wash_out(controller_name, options)


Expand Down
4 changes: 1 addition & 3 deletions lib/washout_builder/engine.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
module WashoutBuilder
class Engine < ::Rails::Engine
isolate_namespace WashoutBuilder
initializer "wash_out.configuration" do |app|
app.routes.append do
match "/washout" => "washout_builder#all", :via => :get, :format => false
end
if app.config.wash_out[:catch_xml_errors]
app.config.middleware.insert_after 'ActionDispatch::ShowExceptions', WashOut::Middleware if defined?(WashOut::Middleware)
app.config.middleware.insert_after 'ActionDispatch::ShowExceptions', WashOut::Middlewares::Catcher if defined?(WashOut::Middlewares::Catcher)
Expand Down
2 changes: 1 addition & 1 deletion lib/washout_builder/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module WashoutBuilder
VERSION = "0.11.4"
VERSION = "0.11.5"
end

0 comments on commit 1d4d6e7

Please sign in to comment.