I’m slightly new at Rails, so any help would be appreciated!
I have two models that have no association with each other (but they
probably be many-to-many). One is called ‘Course’ and contains seed data
Golf Courses. The other is called ‘Player’ and contains user entered
information. Ultimately, I want to show a table in my view that displays
all the golf courses appropriate for the player, based upon some
calculations I’m doing in my Player model. However, I need to utilize
of the attributes from the Course model in my calculations.
Right now, all my methods are in the Player model, so I’m doing
like this but am getting an 'undefined method ‘Course’ error. What am I
class Model < ActiveRecord::Base
attr_accessible :attr_1, :attr_2, …etc
Course.handicap (This is what I’m using to call the Course handicap,
but it’s not working out) - player_handicap + some more math
Thanks for the help!