Learning Rails
Learning Rails By Simon St. Laurent, Edd Dumbill
November 2008
Pages: 442


Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Chapter 8; File Upload Form; Name Error
abbyworld
post May 30 2009, 10:23 PM
Post #1


New Member
*

Group: Members
Posts: 1
Joined: 30-May 09
Member No.: 18,399



I'm very new to Rails, so please bear with me.

I'm getting a name error when I try to look at my show view in my browser. I followed the book's instructions verbatim, I even included the change to the code on page 124 as noted in the errata. Any tips on what I may be doing wrong here?

Here's the error that I'm getting:

CODE
undefined local variable or method `extension' for #<Theater:0x24fa2d4>

Extracted source (around line #4):

<table width="730" border="0" align="center" id="show_table">
2: <tr>
3: <td rowspan="6" align="left" valign="top">
4: <% if @theater.has_photo? %>
5: <%= image_tag @theater.photo_path %>
6: <% else %>
7: No photo.


Note: "theater" is the name of the table that I'm inserting the extension column into; it takes the place of "person" in the book example.

Also, I'm running Rails on a Mac and editing with Xcode, if that helps.

Thanks very much!
Go to the top of the page
 
+Quote Post
simonstl
post Jun 1 2009, 06:37 AM
Post #2


Active Member
**

Group: O'Reilly Editor
Posts: 33
Joined: 17-September 08
Member No.: 1,159



It's a little tricky, because you've added it to a different model, but we're guessing that you probably haven't run the migration that adds the extension field to your Theater model.

Could you take a look at that and let us know?

Thanks!
Go to the top of the page
 
+Quote Post
4insure
post Oct 14 2009, 07:38 PM
Post #3


New Member
*

Group: Members
Posts: 8
Joined: 14-October 09
Member No.: 20,642



to OP... any more comments??? hard to help without clarification

thanks,
james @ auto insurance for young drivers
Go to the top of the page
 
+Quote Post
brian.tomhson
post Nov 14 2009, 07:22 AM
Post #4


New Member
*

Group: Members
Posts: 5
Joined: 14-November 09
Member No.: 21,025



I don’t usually reply to posts but I will in this case. Thank you for all the information.


--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 22nd November 2009 - 04:49 PM