Hi.

I'm trying to monkey patch the rails_admin gem.

First, I tried to add a file in config/initializers containing:
RailsAdmin::MainController.class_eval do
def get_sort_hash
CODE HERE...
end
end

It was only loaded once, and then the method from the gem was always 
executed instead of mine.

I also tried to add the code in lib/ with the correct line in 
config/application.rb to load all files in lib/. But in this case it does 
not work at all.

Each time I defined my method using the following blocks:
RailsAdmin::MainController.class_eval do end
::RailsAdmin::MainController.class_eval do end

Any idea? Thanks.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/R-GP-E-bR8wJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to