Sha256: d1d1378b3efbacb18749d87e194b905478c1b2a4007ae1ba12335f58e6f575f4
Contents?: true
Size: 850 Bytes
Versions: 3
Compression:
Stored size: 850 Bytes
Contents
module ParamsKeeper module Controller extend ActiveSupport::Concern included do class_attribute :keep_params_configs helper ParamsKeeper::Helper end def url_for(options = nil) ParamsKeeper::UrlFor.new(self, self, options).call || super end def redirect_to(options = {}, response_options = {}) return super unless options.is_a?(String) url = ParamsKeeper::UrlFor.new(self, self, options).call url ? super(url, response_options) : super end class_methods do def keep_params(*args) options = args.last.is_a?(Hash) ? args.pop : {} config = ParamsKeeper::Config.new(args, options) self.keep_params_configs = keep_params_configs.to_a + [config] end def clear_keep_params! self.keep_params_configs = nil end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
params_keeper_rails-1.2.2 | lib/params_keeper/controller.rb |
params_keeper_rails-1.2.1 | lib/params_keeper/controller.rb |
params_keeper_rails-1.2.0 | lib/params_keeper/controller.rb |