I have a problem for hours and hours but I can't find the solution. I find some similar questions to mine, but still no luck. I have a method in my controller :
def get_game_site_log_id(game)
Game_site_log.connection.select_values("SELECT id FROM game_site_logs
WHERE game_id = " + game["game_id"] + "AND site_id = " + @site.id + ";")
end
I got LoadError expected game_site_log.rb to define Game_site_log. I tried to add this :
require File.dirname(__FILE__) + "game_site_log.rb"
But instead of loading the model from game_site_log.rb, it tried to find that file in controller. What is the best solution to this? Thanks :)