Hi, Sebastian
I downloaded FileColumn plugin and love the concept. But when I
tried the example listed on the plugin web site, I got the following
error:
NoMethodError in Entry#new
undefined method `file_column' for Entry:Class
My environement is Red Hat linux 9.0 with mysql 4.1. I installed
file_column under vendor/plugins. If I run “ls”, I get the following
directories:
file_column rails_file_column
I created a directory, " file_column" and copied files under “trunk”
to file_column.
Please see my controller, models and new.rhtml attached.
Could anyone tell me why I got the error? It seems that rails can not
find “file_column” plugin.
Thanks in advance.
–
-Thomas
entry.rb:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
class Entry < ActiveRecord::Base
file_column :image
end
entry_controller.rb:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
class EntryController < ApplicationController
Get information on a new product and
attempt to create a row in the database.
def create
@entry = Entry.new(@params[:entry])
if @entry.save
flash[‘notice’] = ‘Entry was successfully created.’
redirect_to :action => ‘list’
else
render_action ‘new’
end
end
def list
@entry_pages, @entries = paginate :entry, :per_page => 10
end
Initiate the creation of a new product.
The work is completed in #create.
def new
@entry = Entry.new
end
end
Error:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NoMethodError in Entry#new
undefined method `file_column’ for Entry:Class
RAILS_ROOT: ./script/…/config/…/
Application Trace | Framework Trace | Full Trace
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:991:in
method_missing' #{RAILS_ROOT}/app/models/entry.rb:4 /home/txue/downloads/rails-code/depot.0114/app/controllers/entry_controller.rb:21:in
new’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:991:in
method_missing' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:in
load’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:in
load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:39:in
require_or_load’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:22:in
depend_on' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:178:in
require_dependency’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:178:in
require_dependency' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:194:in
const_missing’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:853:in
send' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:853:in
perform_action_without_filters’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/filters.rb:332:in
perform_action_without_benchmark' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
measure' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/rescue.rb:82:in
perform_action' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:in
send’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:in
process_without_session_management_support' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session_management.rb:116:in
process’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in
dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:117:in
handle_dispatch’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:83:in
service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in
service’
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/local/lib/ruby/1.8/webrick/server.rb:155:in
start_thread’
/usr/local/lib/ruby/1.8/webrick/server.rb:144:in start' /usr/local/lib/ruby/1.8/webrick/server.rb:144:in
start_thread’
/usr/local/lib/ruby/1.8/webrick/server.rb:94:in start' /usr/local/lib/ruby/1.8/webrick/server.rb:89:in
each’
/usr/local/lib/ruby/1.8/webrick/server.rb:89:in start' /usr/local/lib/ruby/1.8/webrick/server.rb:79:in
start’
/usr/local/lib/ruby/1.8/webrick/server.rb:79:in start' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:69:in
dispatch’
script/server:51
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:991:in
method_missing' #{RAILS_ROOT}/app/models/entry.rb:4 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:in
load’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:in
load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:39:in
require_or_load’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:22:in
depend_on' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:178:in
require_dependency’
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:178:in
require_dependency' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:194:in
const_missing’
/home/txue/downloads/rails-code/depot.0114/app/controllers/entry_controller.rb:21:in
new' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:853:in
send’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:853:in
perform_action_without_filters' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/filters.rb:332:in
perform_action_without_benchmark’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
measure’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/rescue.rb:82:in
perform_action’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:in
send' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/base.rb:369:in
process_without_session_management_support’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/session_management.rb:116:in
process' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in
dispatch’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:117:in
handle_dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:83:in
service’
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in
run’
/usr/local/lib/ruby/1.8/webrick/server.rb:155:in start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:144:in
start’
/usr/local/lib/ruby/1.8/webrick/server.rb:144:in start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:94:in
start’
/usr/local/lib/ruby/1.8/webrick/server.rb:89:in each' /usr/local/lib/ruby/1.8/webrick/server.rb:89:in
start’
/usr/local/lib/ruby/1.8/webrick/server.rb:79:in start' /usr/local/lib/ruby/1.8/webrick/server.rb:79:in
start’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:69:in
`dispatch’
script/server:51
This error occured while loading the following files:
entry.rb
Request
Parameters: None
Show session dump
flash: !ruby/hash:ActionController::Flash::FlashHash {}
Response
Headers: {“cookie”=>[], “Cache-Control”=>“no-cache”}