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.2.12 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.11 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.10 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.9 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.8 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.7 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.6 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.5 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.4 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.3 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.1 lib/rails_ext/hacks/persistent_params.rb
rails-ext-0.2.0 lib/rails_ext/hacks/persistent_params.rb