OK - here is error log while running in development mode:
Create a controller:
class Plugins::Sidebars::GallerysbController < Sidebars::ComponentPlugin
display_name “Gallery”
description ‘Stuff from the gallery’
setting :pie, ‘foopie’
def content
nil
end
def config
nil
end
end
Note that there are not settings defined. Now attempt to make the
plugin active, after clicking publish changes the following appears in
the development log:
Processing SidebarController#publish (for 192.168.0.48 at 2007-02-10
16:10:18) [POST]
Session ID: 747c57e83bcf016db9dfa9ecffb073b6
Parameters: {“action”=>“publish”, “configure”=>{“1”=>{“empty”=>“0”,
“count”=>“1”}, “2”=>{“body”=>"
- \n
- <a
href="http://www.typosphere.org" title="Typo">Typo \n
- too-biased \n
- poocs.net \n
- Seth Hall \n
- EncyteMedia \n
- scottstuff.net \n
- Just A Summary \n
- Topfunky \n
- PlanetTypo \n
- Typo Forums \n
- Typo
- too-biased
- poocs.net
- Seth Hall
- EncyteMedia
- scottstuff.net
- Just A Summary
- Topfunky
- PlanetTypo
- Typo Forums
’ WHERE id = 2
Sidebar Load (0.000539) SELECT * FROM sidebars WHERE (sidebars.id =
3) LIMIT 1
NoMethodError (You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.each):
/app/controllers/admin/sidebar_controller.rb:60:in publish' /app/controllers/admin/sidebar_controller.rb:55:in
publish’
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:51:in
transaction' /vendor/rails/activerecord/lib/active_record/transactions.rb:91:in
transaction’
/app/controllers/admin/sidebar_controller.rb:51:in publish' /vendor/rails/actionpack/lib/action_controller/base.rb:941:in
perform_action_without_filters’
/vendor/rails/actionpack/lib/action_controller/filters.rb:368:in
perform_action_without_benchmark' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue’
/usr/local/lib/ruby/1.8/benchmark.rb:293:in measure' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue’
/vendor/rails/actionpack/lib/action_controller/rescue.rb:82:in
perform_action' /vendor/rails/actionpack/lib/action_controller/base.rb:408:in
process_without_filters’
/vendor/rails/actionpack/lib/action_controller/filters.rb:377:in
process_without_session_management_support' /vendor/rails/actionpack/lib/action_controller/session_management.rb:117:in
process’
/vendor/rails/railties/lib/dispatcher.rb:38:in dispatch' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:84:in
process’
/usr/local/lib/ruby/1.8/sync.rb:229:in synchronize' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:83:in
process’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:580:in
process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:in
process_client’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in
run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in
run’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:in
run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:267:in
run’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:in
run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:127:in
run’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb:211:in
`run’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:231
/usr/local/bin/mongrel_rails:18
SQL (0.003495) PRAGMA table_info(users)
Rendering
/Users/james/rails/typo_test/config/…/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.rhtml
(500 Internal Error)
Uncommenting the setting in the controller allows everthing to work
correctly.
Cheers,
Stephen.