Sha256: bc4cb30b61398efab07dc00ac378c5dc5572acb95ad574b67c377851079cfbef

Contents?: true

Size: 501 Bytes

Versions: 2

Compression:

Stored size: 501 Bytes

Contents

module ActionDispatch::Routing
  class Mapper
    protected

    def lolita_file_upload_route mapping, controllers
      # /lolita/articles/1/pictures/5
      resources mapping.plural, :module=>mapping.module do
        collection do
          match "/:association/create", :to => "#{controllers[:uploads]}#create", :as => "create_upload", :method => :post
        end
        resources :uploads, :controller => controllers[:uploads], :path => "/:association"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lolita-file-upload-0.2.1 lib/lolita-file-upload/rails/file_upload_routes.rb
lolita-file-upload-0.2.0 lib/lolita-file-upload/rails/file_upload_routes.rb