On Jul 6, 4:40 pm, Michel Pigassou <[email protected]> wrote:
> Hi.
>
> I'm trying to monkey patch the rails_admin gem.
>
Not entirely answering the question, but why not just fork it on
github? Bundler makes it super easy to install gems from your own git
repo

Fred

> 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 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