Sha256: 70262225f239371530e3640688564b22ddfd5da13ee911403cf66c32f9ec5716

Contents?: true

Size: 563 Bytes

Versions: 15

Compression:

Stored size: 563 Bytes

Contents

module Jets::Router::Resources
  class Options < Base
    def build(action)
      # Important to create a copy of the options since we are mutating it
      # The original options are used for resources and resource scope
      options = @options.dup
      # Remove special options from getting to create_route. For some reason .slice! doesnt work
      options.delete(:only)
      options.delete(:except)
      controller = options[:singular_resource] ? @name.to_s.pluralize : @name
      options[:to] = "#{controller}##{action}"
      options
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
jets-5.0.13 lib/jets/router/resources/options.rb
jets-5.0.12 lib/jets/router/resources/options.rb
jets-5.0.11 lib/jets/router/resources/options.rb
jets-5.0.10 lib/jets/router/resources/options.rb
jets-5.0.9 lib/jets/router/resources/options.rb
jets-5.0.8 lib/jets/router/resources/options.rb
jets-5.0.7 lib/jets/router/resources/options.rb
jets-5.0.6 lib/jets/router/resources/options.rb
jets-5.0.5 lib/jets/router/resources/options.rb
jets-5.0.4 lib/jets/router/resources/options.rb
jets-5.0.3 lib/jets/router/resources/options.rb
jets-5.0.2 lib/jets/router/resources/options.rb
jets-5.0.1 lib/jets/router/resources/options.rb
jets-5.0.0 lib/jets/router/resources/options.rb
jets-5.0.0.beta1 lib/jets/router/resources/options.rb