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