# Error on belongs\_to method

**URL:** <https://www.ruby-forum.com/t/error-on-belongs-to-method/132019>\
**Category:** Rails\
**Created:** [March 15, 2008, 1:39pm UTC](https://www.ruby-forum.com/t/error-on-belongs-to-method/132019 "2008-03-15T13:39:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shygoly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@shygoly](https://www.ruby-forum.com/u/shygoly)\
**Post date:** [March 15, 2008, 1:39pm UTC](https://www.ruby-forum.com/t/error-on-belongs-to-method/132019/1 "2008-03-15T13:39:06Z")

</div>

I followed the Ruby on Rails up and running book published by Orielly.  
there are three DB tables, photo, slideshow, and slide

the Slide class in slide.rb is like this:  
class Slide \< ActiveRecord::Base  
belongs\_to :photo :foreign\_key =\>photo\_id  
belongs\_to :slideshow :foreign\_key=\>slideshow\_id  
end

I inserted the sample data into database. When I trying to run the  
command on page39:  
slide= Slide.find 1  
it give me the following error:  
…/slide.rb:2: syntax error, unexpected ‘;’, expecting kEND.  
and the same with …/slide.rb:3

can anybody help me? if you can tell me how to debug rails, that will  
be more better? thanks in advance.

---

<div class="post-metadata">

**Author:** ![shygoly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@shygoly](https://www.ruby-forum.com/u/shygoly)\
**Post date:** [March 15, 2008, 2:07pm UTC](https://www.ruby-forum.com/t/error-on-belongs-to-method/132019/2 "2008-03-15T14:07:53Z")

</div>

sorry for asking a so stupid question.  
I found that I missed the commas.
