Sha256: de4c995e047f61e8f179909e6f132eb9aad7dcd5875756c0f935a8ffc15f2868

Contents?: true

Size: 612 Bytes

Versions: 5

Compression:

Stored size: 612 Bytes

Contents

module ActionDispatch::Routing
  class Mapper

    def supercharged(options = {})
      controllers = {
        charges: "supercharged/charges",
        gateway_notifications: "supercharged/gateway_notifications"
      }
      controllers.merge!(options[:controllers]) if options[:controllers]

      resources :charges, only: [:new, :create], controller: controllers[:charges] do
        collection do
          post :setup_purchase
          get :complete
        end
      end

      match "gateways/:gateway/result" => "#{controllers[:gateway_notifications]}#create", as: :gateways_result
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
supercharged-2.0.4 config/routes.rb
supercharged-2.0.3 config/routes.rb
supercharged-2.0.2 config/routes.rb
supercharged-2.0.1 config/routes.rb
supercharged-2.0.0 config/routes.rb