Sha256: af3dff384afbc61608ff13db72a7ec3d0c59407a908f66bc8d89ceb9ddf4d689

Contents?: true

Size: 970 Bytes

Versions: 2

Compression:

Stored size: 970 Bytes

Contents

if ActionController::Routing.name =~ /ActionDispatch/
  
  # Rails 3.x

  module ActionDispatch::Routing
    class RouteSet #:nodoc:
      Mapper.class_eval do
        def cloudfuji_routes
          Rails.application.routes.draw do
            namespace 'cloudfuji' do
              resources :envs, :only => [ :update ]
              match '/data' => "data#index"

              # TODO restrict to POST-only
              match '/mail' => "mail#index"
            end
          end
        end
      end
    end
  end

else

  # Rails 2.x
  module ActionController::Routing
    class RouteSet
      
      Mapper.class_eval do
        def cloudfuji_routes
          namespace 'cloudfuji' do |cloudfuji|
            cloudfuji.resources :envs, :only => [ :update ]
            cloudfuji.connect '/data', :controller=>:data, :action=>:index
            cloudfuji.connect '/mail', :controller=>:mail, :action=>:index
          end
        end
      end

    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cloudfuji-0.0.38 lib/rails/routes.rb
cloudfuji-0.0.37 lib/rails/routes.rb