Sha256: 2a418016f13f889889c408ee17be8b35187cfcdd38da4a08f9263bf066650204

Contents?: true

Size: 706 Bytes

Versions: 52

Compression:

Stored size: 706 Bytes

Contents

# By default Rails optimizes named routes and doesn't adds default_url_options, so we fix this.
ActionController::Base.send :helper_method, :default_url_options

ActionController::Routing::Optimisation::PositionalArguments.send :class_eval do
  def guard_conditions_with_def_url_opt
    guard_conditions_without_def_url_opt << "default_url_options(nil).blank?"
  end
  alias_method_chain :guard_conditions, :def_url_opt
end

ActionController::Routing::Optimisation::PositionalArgumentsWithAdditionalParams.send :class_eval do
  def guard_conditions_with_def_url_opt
    guard_conditions_without_def_url_opt << "default_url_options(nil).blank?"
  end
  alias_method_chain :guard_conditions, :def_url_opt
end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
rails-ext-0.3.11 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.3.10 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.3.9 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.3.8 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.3.6 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.3.5 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.3.4 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.3.3 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.3.2 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.3.1 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.3 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.21 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.20 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.19 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.18 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.17 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.16 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.15 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.14 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.13 lib/rails_ext/hacks/persistent_params.rb