Sha256: 34e8c22c2cf45cf2399f874ddf1edafee6787212e97a8d755c840997f4cbcc66

Contents?: true

Size: 433 Bytes

Versions: 5

Compression:

Stored size: 433 Bytes

Contents

module Voltron
  module Upload
    module Routes

      def upload_for(resource, options={})
        controller = resource.to_s.underscore
        options = options.with_indifferent_access

        options[:path] ||= "/#{controller}/upload"
        options[:controller] ||= controller

        post options[:path].gsub(/(^\/+|\/+$)/, ''), to: "#{options[:controller]}#upload", as: "upload_#{controller}"
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
voltron-upload-0.2.5 lib/voltron/upload/action_dispatch/routes.rb
voltron-upload-0.2.2 lib/voltron/upload/action_dispatch/routes.rb
voltron-upload-0.2.3 lib/voltron/upload/action_dispatch/routes.rb
voltron-upload-0.2.1 lib/voltron/upload/action_dispatch/routes.rb
voltron-upload-0.2.4 lib/voltron/upload/action_dispatch/routes.rb