Scaffold (Agile Web Development With Rails)

What am I doing wrong here?

[app/controllers/admin_controller.rb]
class AdminController < ApplicationController

before_filter :authorize

def index
list
render :action => ‘list’
end

GETs should be safe (see

http://www.w3.org/2001/tag/doc/whenToUseGet.html)
verify :method => :post, :only => [ :destroy, :create, :update ],
:redirect_to => { :action => :list }

def list
@product_pages, @products = paginate :products, :per_page => 10
end
[app/controllers/admin_controller.rb]

[output]
NoMethodError in AdminController#index

undefined method `paginate’ for #AdminController:0xb77e0b78

RAILS_ROOT: /home/davi/documentos/rails/depot
Application Trace | Framework Trace | Full Trace

app/controllers/admin_controller.rb:15:in list' app/controllers/admin_controller.rb:6:inindex’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/base.rb:1136:in
send' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/base.rb:1136:inperform_action_without_filters’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/filters.rb:713:in
call_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/filters.rb:752:inperform_action_without_benchmark’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:inmeasure’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/rescue.rb:133:inperform_action_without_caching’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/caching.rb:663:in
perform_action' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3.7116/lib/active_record/query_cache.rb:99:incache’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/caching.rb:662:in
perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/base.rb:494:insend’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/base.rb:494:in
process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/filters.rb:747:inprocess_without_session_management_support’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/session_management.rb:122:in
process' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/base.rb:346:inprocess’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3.7116/lib/dispatcher.rb:39:in
dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3.7116/lib/webrick_server.rb:112:inhandle_dispatch’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3.7116/lib/webrick_server.rb:78:in
service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:162:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:ineach’
/usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:instart’
/usr/lib/ruby/1.8/webrick/server.rb:82:in start' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3.7116/lib/webrick_server.rb:62:indispatch’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3.7116/lib/commands/servers/webrick.rb:65
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2.7116/lib/active_support/dependencies.rb:495:in
require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2.7116/lib/active_support/dependencies.rb:342:innew_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2.7116/lib/active_support/dependencies.rb:495:in
require' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3.7116/lib/commands/server.rb:39 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:ingem_original_require’
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
script/server:3

app/controllers/admin_controller.rb:15:in list' app/controllers/admin_controller.rb:6:inindex’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/base.rb:1136:in
send' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/base.rb:1136:inperform_action_without_filters’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/filters.rb:713:in
call_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/filters.rb:752:inperform_action_without_benchmark’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:inmeasure’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/rescue.rb:133:inperform_action_without_caching’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/caching.rb:663:in
perform_action' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3.7116/lib/active_record/query_cache.rb:99:incache’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/caching.rb:662:in
perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/base.rb:494:insend’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/base.rb:494:in
process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/filters.rb:747:inprocess_without_session_management_support’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/session_management.rb:122:in
process' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3.7116/lib/action_controller/base.rb:346:inprocess’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3.7116/lib/dispatcher.rb:39:in
dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3.7116/lib/webrick_server.rb:112:inhandle_dispatch’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3.7116/lib/webrick_server.rb:78:in
service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:162:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:ineach’
/usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:instart’
/usr/lib/ruby/1.8/webrick/server.rb:82:in start' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3.7116/lib/webrick_server.rb:62:indispatch’
/usr/lib/ruby/gems/1.8/gems/rails-1.2.3.7116/lib/commands/servers/webrick.rb:65
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2.7116/lib/active_support/dependencies.rb:495:in
require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2.7116/lib/active_support/dependencies.rb:342:innew_constants_in’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2.7116/lib/active_support/dependencies.rb:495:in
require' /usr/lib/ruby/gems/1.8/gems/rails-1.2.3.7116/lib/commands/server.rb:39 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:ingem_original_require’
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
script/server:3

Request

Parameters:

None

Show session dump


:original_uri:
:user_id: 1
flash: !map:ActionController::Flash::FlashHash {}

Response

Headers:

{“cookie”=>[],
“Cache-Control”=>“no-cache”}
[output]

Any tip?
AFAIK, my code is identical from the book.

Sorry the poor english.

Thanks.

Davi V.

E-mail: [email protected]
MSN : [email protected]
GTalk : [email protected]
Skype : davi vidal
ICQ : 138815296

Em Sexta 17 Agosto 2007 19:42, Davi escreveu:

What am I doing wrong here?

I was using Rails 1.2.3.7116 instead 1.2.3.
Uninstalled 1.2.3.7116 and all is working fine.

Thanks for attention,

Davi V.

E-mail: [email protected]
MSN : [email protected]
GTalk : [email protected]
Skype : davi vidal
ICQ : 138815296

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs