You've defined a method on ApplicationController (and hence it's
subclasses) but you're calling it on an instance of Hash.
Perhaps the quickest way out would to make that method take as an
argument the hash to work on.
Fred
This is the second time that I have made this type of error. Perhaps
eventually I will learn to understand what I am reading.
(PS: the .* in your regexp does nothing, and certainly doesn't
guarentee that the match is found at the end of the string)
I take your point. This is what I ended up with in
config/initializers/hash_addins.rb
class Hash
def datebalk!
# set regexp for datebalks generated attributes
c = /__dteblk\Z/
# Remove datebalks generated attributes from params hash
delete_if { |k, v| c =~ k.to_s }
end
end
And this works just fine. Thank you very much for the pointers.