O'Reilly Forums: Chapter 8; File Upload Form; Name Error - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Chapter 8; File Upload Form; Name Error

#1 User is offline   abbyworld 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 30-May 09

  Posted 30 May 2009 - 10:23 PM

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!
0

#2 User is offline   simonstl 

  • Active Member
  • PipPip
  • Group: O'Reilly Editor
  • Posts: 35
  • Joined: 17-September 08

Posted 01 June 2009 - 06:37 AM

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!
0

#3 User is offline   Jeename 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 21-November 10

Posted 21 November 2010 - 09:41 PM

For all such type of name errors i am using a very handy tool which is available at http://pathtoodeep.com ,it will resolve this error in just a second
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users