Sha256: ba887f90cdf2fec2ad697e663d47bc8de502dbc516353c500e0633e5afc551c9

Contents?: true

Size: 408 Bytes

Versions: 7

Compression:

Stored size: 408 Bytes

Contents

##
# Support the `as` option. As Rage currently doesn't generate named route helpers, we simply ignore it.
#
# @example
#   get "/photos/:id", to: "photos#show", as: :user_photos
module Rage::Router::DSLPlugins::NamedRouteHelpers
  %i(get post put patch delete).each do |action_name|
    define_method(action_name) do |*args, **kwargs|
      kwargs.delete(:as)
      super(*args, **kwargs)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rage-rb-1.11.0 lib/rage/router/dsl_plugins/named_route_helpers.rb
rage-rb-1.10.1 lib/rage/router/dsl_plugins/named_route_helpers.rb
rage-rb-1.10.0 lib/rage/router/dsl_plugins/named_route_helpers.rb
rage-rb-1.9.0 lib/rage/router/dsl_plugins/named_route_helpers.rb
rage-rb-1.8.0 lib/rage/router/dsl_plugins/named_route_helpers.rb
rage-rb-1.7.0 lib/rage/router/dsl_plugins/named_route_helpers.rb
rage-rb-1.6.0 lib/rage/router/dsl_plugins/named_route_helpers.rb