BTW, those errors when you tried to debug with puts are because
Haml::Buffer includes Haml::Helpers which defines a puts that works in
the template.  Calling it inside Haml::Buffer causes an error.  If you
want to "debug by printf" in Haml::Buffer, use "$stdout << 'debugging
stuff'" instead of puts.

It seems like the helpers that the Buffer needs to call and that the
template can call should be separate to prevent this sort of
confusion.

On Jun 7, 5:44 am, "Russell Norris" <[EMAIL PROTECTED]> wrote:
> This is happening all over my code. I tried a few puts but inspecting the
> attributes or attributes_hash [which I suspect is the problem] raises an
> error about undefined method 'buffer' for "":String. :/ Here's the backtrace
> without the puts...
>
> ActionView::TemplateError: undefined method `merge!' for "":String
>     On line #2 of app/views/categories/_form.haml
>
>     1: %p
>     2:   %label{:for => :category_title} Title
>     3:   = f.text_field :title, :size => 50, :class => :text
>     4: %p
>     5:   %label{:for => :category_misc} Description <em>(optional)</em>
>
>     app/views/categories/_form.haml:2
>     vendor/plugins/haml/lib/haml/buffer.rb:121:in `merge_attrs'
>     vendor/plugins/haml/lib/haml/buffer.rb:92:in `open_tag'
>     (eval):12:in `_render_haml_2'
>     vendor/plugins/haml/lib/haml/engine.rb:434:in `send'
>     vendor/plugins/haml/lib/haml/engine.rb:434:in `compile'
>     vendor/plugins/haml/lib/haml/engine.rb:186:in `to_html'
>     vendor/plugins/haml/lib/haml/template.rb:69:in `render'
>     vendor/rails/actionpack/lib/action_view/base.rb:502:in `delegate_render'
>     vendor/rails/actionpack/lib/action_view/base.rb:324:in
> `render_template_old'
>     vendor/plugins/haml/lib/haml/template.rb:96:in `render_template'
>     vendor/rails/actionpack/lib/action_view/base.rb:286:in `render_file'
>     vendor/rails/actionpack/lib/action_view/base.rb:301:in
> `render_without_haml'
>     vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb:17:in `render'
>     vendor/rails/actionpack/lib/action_view/partials.rb:62:in
> `render_partial'
>     vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in
> `benchmark'
>     /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
>     /usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
>     vendor/rails/actionpack/lib/action_controller/benchmarking.rb:26:in
> `benchmark'
>     vendor/rails/actionpack/lib/action_view/partials.rb:61:in
> `render_partial'
>     vendor/rails/actionpack/lib/action_view/base.rb:312:in
> `render_without_haml'
>     vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb:17:in `render'
>     (eval):12:in `_render_haml_1'
>     vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb:82:in `call'
>     vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb:82:in
> `form_for'
>     vendor/plugins/haml/lib/haml/helpers.rb:284:in `call'
>     vendor/plugins/haml/lib/haml/helpers.rb:284:in `bind_proc'
>     vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:220:in
> `fields_for'
>     vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:180:in
> `form_for_without_haml'
>     vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb:86:in
> `form_for'
>     (eval):10:in `_render_haml_1'
>     vendor/plugins/haml/lib/haml/engine.rb:434:in `send'
>     vendor/plugins/haml/lib/haml/engine.rb:434:in `compile'
>     vendor/plugins/haml/lib/haml/engine.rb:186:in `to_html'
>     vendor/plugins/haml/lib/haml/template.rb:69:in `render'
>     vendor/rails/actionpack/lib/action_view/base.rb:502:in `delegate_render'
>     vendor/rails/actionpack/lib/action_view/base.rb:324:in
> `render_template_old'
>     vendor/plugins/haml/lib/haml/template.rb:96:in `render_template'
>     vendor/rails/actionpack/lib/action_view/base.rb:286:in `render_file'
>     vendor/rails/actionpack/lib/action_controller/base.rb:875:in
> `render_file'
>     vendor/rails/actionpack/lib/action_controller/base.rb:810:in
> `render_with_no_layout'
>     vendor/rails/actionpack/lib/action_controller/layout.rb:246:in
> `render_without_benchmark'
>     vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in
> `render_without_query_stats'
>     /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
>     vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in
> `render_without_query_stats'
>     vendor/plugins/query_stats/lib/query_stats/labeler.rb:19:in `render'
>     app/controllers/oyster_controller.rb:113:in `render_common_form'
>     app/controllers/categories_controller.rb:12:in `new'
>     vendor/rails/actionpack/lib/action_controller/base.rb:1132:in `send'
>     vendor/rails/actionpack/lib/action_controller/base.rb:1132:in
> `perform_action_without_filters'
>     vendor/rails/actionpack/lib/action_controller/filters.rb:713:in
> `call_filters'
>     vendor/rails/actionpack/lib/action_controller/filters.rb:752:in
> `perform_action_without_benchmark'
>     vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
> `perform_action_without_rescue'
>     /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
>     vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
> `perform_action_without_rescue'
>     vendor/rails/actionpack/lib/action_controller/rescue.rb:133:in
> `perform_action_without_caching'
>     vendor/rails/actionpack/lib/action_controller/caching.rb:661:in
> `perform_action'
>     vendor/rails/activerecord/lib/active_record/query_cache.rb:99:in `cache'
>     vendor/rails/actionpack/lib/action_controller/caching.rb:660:in
> `perform_action'
>     vendor/rails/actionpack/lib/action_controller/base.rb:494:in `send'
>     vendor/rails/actionpack/lib/action_controller/base.rb:494:in
> `process_without_filters'
>     vendor/rails/actionpack/lib/action_controller/filters.rb:747:in
> `process_without_session_management_support'
>
> vendor/rails/actionpack/lib/action_controller/session_management.rb:122:in
> `sass_old_process'
>     vendor/plugins/haml/lib/sass/plugin.rb:124:in `process_without_test'
>     vendor/rails/actionpack/lib/action_controller/test_process.rb:15:in
> `process'
>     vendor/rails/actionpack/lib/action_controller/test_process.rb:394:in
> `process'
>     vendor/rails/actionpack/lib/action_controller/test_process.rb:365:in
> `get'
>     test/functional/categories_controller_test.rb:43:in `test_new'
>     test/test_helper.rb:43:in `active_users'
>     test/test_helper.rb:42:in `each'
>     test/test_helper.rb:42:in `active_users'
>     test/functional/categories_controller_test.rb:41:in `test_new'
>     /usr/lib/ruby/1.8/test/unit/testcase.rb:78:in `__send__'
>     /usr/lib/ruby/1.8/test/unit/testcase.rb:78:in `run'
>     /usr/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
>     /usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
>     /usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
>     /usr/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
>     /usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
>     /usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
>     /usr/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite'
>     /usr/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in
> `start_mediator'
>     /usr/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in `start'
>     /usr/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in `run'
>     /usr/lib/ruby/1.8/test/unit/autorunner.rb:200:in `run'
>     /usr/lib/ruby/1.8/test/unit/autorunner.rb:13:in `run'
>     /usr/lib/ruby/1.8/test/unit.rb:278
>     test/functional/categories_controller_test.rb:94
>
> RSL


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to