browsermedia/browsercms — Issue #465: undefined method `formats' for nil:NilClass
Author: cdavaz
Created: 2012-01-13 21:23:15+00:00
State: open

Maybe I'm doing something wrong here, but let's see. I am testing out dynamic template and partial creation. You can see the template and partial have been written to disk by BrowserCMS as so:

-(~/cdef-cms/tmp/views)-(ruby-1.9.3-p0@cms)--
--(2012-01-13:09:21:02:$)-- tree
.
|-- layouts
| `-- templates
| `-- test_dynamic_template.html.erb
`-- partials
`-- _test_dynamic_partial.html.erb

3 directories, 2 files

The contents of test_dynamic_template.html.erb:

<%= page_title %>

<%= yield :html_head %>

<%= cms_toolbar %>

Test Dynamic Template

<%= render :partials => "partials/test_dynamic_partial" %>

The contents of _test_dynamic_partial.html.erb

Dynamic Partial with Container

<%= container :test %>

When creating a page with this template I get the following stacktrace:

Message

undefined method `formats' for nil:NilClass

Stacktrace

/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/whiny_nil.rb:48:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_view/render/rendering.rb:25:in `render'
/var/www/web/cdef-cms/tmp/views/layouts/templates/test_dynamic_template.html.erb:16:in `_tmp_views_layouts_templates_test_dynamic_template_html_erb___1829258307476577759_297885540__3818089738901345792'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_view/template.rb:162:in `block in render'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/notifications.rb:54:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_view/template.rb:154:in `render'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_view/render/layouts.rb:80:in `_render_layout'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_view/render/rendering.rb:62:in `block in _render_template'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/notifications.rb:52:in `block in instrument'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/notifications.rb:52:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_view/render/rendering.rb:56:in `_render_template'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_view/render/rendering.rb:26:in `render'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/abstract_controller/rendering.rb:115:in `_render_template'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/abstract_controller/rendering.rb:109:in `render_to_body'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_controller/metal/renderers.rb:47:in `render_to_body'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/abstract_controller/rendering.rb:102:in `render_to_string'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/abstract_controller/rendering.rb:93:in `render'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_controller/metal/rendering.rb:17:in `render'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activerecord-3.0.11/lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_controller/metal/instrumentation.rb:39:in `render'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/browsercms-3.3.2/app/controllers/cms/content_controller.rb:44:in `render_page'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/browsercms-3.3.2/app/controllers/cms/content_controller.rb:153:in `check_access_to_page'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/callbacks.rb:457:in `_run__2974202968501152161__process_action__3704351767409904419__callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/callbacks.rb:94:in `run_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/abstract_controller/callbacks.rb:17:in `process_action'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_controller/metal/rescue.rb:17:in `process_action'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/notifications.rb:52:in `block in instrument'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/notifications.rb:52:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/abstract_controller/base.rb:119:in `process'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/abstract_controller/rendering.rb:41:in `process'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_controller/metal.rb:138:in `dispatch'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_controller/metal.rb:178:in `block in action'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/routing/route_set.rb:62:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/routing/route_set.rb:27:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:148:in `block in call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:93:in `block in recognize'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:75:in `optimized_each'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:92:in `recognize'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:139:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/routing/route_set.rb:493:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/middleware/head.rb:14:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/rack-1.2.4/lib/rack/methodoverride.rb:24:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/middleware/flash.rb:182:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/middleware/cookies.rb:302:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activerecord-3.0.11/lib/active_record/query_cache.rb:32:in `block in call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activerecord-3.0.11/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activerecord-3.0.11/lib/active_record/query_cache.rb:12:in `cache'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activerecord-3.0.11/lib/active_record/query_cache.rb:31:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activerecord-3.0.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/rack-1.2.4/lib/rack/sendfile.rb:106:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/railties-3.0.11/lib/rails/rack/logger.rb:13:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/rack-1.2.4/lib/rack/runtime.rb:17:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/activesupport-3.0.11/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/rack-1.2.4/lib/rack/lock.rb:11:in `block in call'
:10:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/rack-1.2.4/lib/rack/lock.rb:11:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/middleware/static.rb:30:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/actionpack-3.0.11/lib/action_dispatch/middleware/static.rb:30:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/railties-3.0.11/lib/rails/application.rb:168:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/railties-3.0.11/lib/rails/application.rb:77:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:206:in `start_request_handler'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/utils.rb:479:in `safe_fork'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:180:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
:10:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
/usr/local/rvm/gems/ruby-1.9.3-p0@cms/gems/passenger-3.0.11/helper-scripts/passenger-spawn-server:99:in `

'