# File\_column plugin: get undefined method 'file\_column' error

**URL:** <https://www.ruby-forum.com/t/file-column-plugin-get-undefined-method-file-column-error/111511>\
**Category:** Rails\
**Created:** [August 8, 2007, 4:47am UTC](https://www.ruby-forum.com/t/file-column-plugin-get-undefined-method-file-column-error/111511 "2007-08-08T04:47:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LAB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@LAB](https://www.ruby-forum.com/u/LAB)\
**Post date:** [August 8, 2007, 4:47am UTC](https://www.ruby-forum.com/t/file-column-plugin-get-undefined-method-file-column-error/111511/1 "2007-08-08T04:47:38Z")

</div>

I’ve install the ‘file\_column’ plugin properly following instructions  
from the Rails Cookbook and other sources on the web. The file\_column  
files are located under vendor\plugins\file\_column. I then add this  
to my controller:

file\_column :photo1

where photo1 is the column in my table that will hold the image.

then in my views I have a multipart form that has functionality to  
upload the image:

Photo  
\<%= file\_column\_field "table", "photo1" %\>

I restarted my webserver, but every time I try to connect to the view  
with that multipart form I get the error:  
"undefined method ‘file\_column’ for \<\>::Class

RAILS\_ROOT: /MyApp/config/…  
#{RAILS\_ROOT}/app/controllers/mycontroller.rb:5  
/usr/bin/monrel\_rails:16 in ‘load’  
/usr/bin/mongrel\_rails:16

Line 5 in mycontroller.rb is where I use the call to  
‘file\_column :photo1’. It’s like the plugin is not really getting  
loaded even though it is sitting in my plugin directory. There are a  
ton of threads on the web about this problem … but I haven’t found a  
solution yet. Any thoughts out there would be _greatly_  
appreciated!! I really want to see this work!

Thanks in advance!  
Leah

---

<div class="post-metadata">

**Author:** ![LAB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@LAB](https://www.ruby-forum.com/u/LAB)\
**Post date:** [August 8, 2007, 11:04am UTC](https://www.ruby-forum.com/t/file-column-plugin-get-undefined-method-file-column-error/111511/2 "2007-08-08T11:04:13Z")

</div>

LAB wrote:

> I’ve install the ‘file\_column’ plugin properly following instructions  
> from the Rails Cookbook and other sources on the web. The file\_column  
> files are located under vendor\plugins\file\_column. I then add this  
> to my controller:
> 
> file\_column :photo1
> 
> where photo1 is the column in my table that will hold the image.

The “file\_column :photo1” line should go in your “Table” model,  
not in the controller.

–  
We develop, watch us RoR, in numbers too big to ignore.

---

<div class="post-metadata">

**Author:** ![LAB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@LAB](https://www.ruby-forum.com/u/LAB)\
**Post date:** [August 8, 2007, 3:56pm UTC](https://www.ruby-forum.com/t/file-column-plugin-get-undefined-method-file-column-error/111511/3 "2007-08-08T15:56:12Z")

</div>

GENIUS! 😉 Thanks!
