I''ve been following the rails 2.0.2 tutorial at
http://developer.apple.com/tools/developonrailsleopard.html
I get the syntax error below after I put in the relation. I cut and
pasted the relation for all three models from the website to be sure
that there wasn''t a typo. Any ideas?
========================================/Projects/expenses/app/models/event.rb:2:
syntax error, unexpected
tIDENTIFIER, expecting kEND
validates_presence_of :name
validates_numericality_of :budget, :greater_than => 0.0
has_many :expenses
has_many :vendors, :through => :expenses
^
/Projects/expenses/app/models/event.rb:2: syntax error, unexpected
tASSOC, expecting tCOLON2 or ''['' or ''.''
validates_presence_of :name
validates_numericality_of :budget, :greater_than => 0.0
has_many :expenses
has_many :vendors, :through => :expenses
=======================================
Here are my relations
class Expense < ActiveRecord::Base
belongs_to :event
belongs_to :vendor
end
class Event < ActiveRecord::Base
validates_presence_of :name
validates_numericality_of :budget, :greater_than => 0.0
has_many :expenses
has_many :vendors, :through => :expenses
end
class Vendor < ActiveRecord::Base
has_many :expenses
has_many :events, :through => :expenses
end
-Anthony
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---