Looks like I can get past that error and still use pagination:
with="&@categories" Don't know why hobo does not pick up the context.
The form works fine when I don't use ajax, but something goes wrong
when the controller is called with Ajax and part is used.

What does this error mean?

NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.empty?
        from vendor/plugins/hobo/hobo/taglibs/rapid_generics.dryml:34:in
`collection'
        from /Users/atmorell/Sites/blog/vendor/plugins/hobo/dryml/lib/dryml/
template_environment.rb:326:in `_tag_context'
        from /Users/atmorell/Sites/blog/vendor/plugins/hobo/dryml/lib/dryml/
template_environment.rb:267:in `new_object_context'
        from /Users/atmorell/Sites/blog/vendor/plugins/hobo/dryml/lib/dryml/
template_environment.rb:248:in `new_context'
        from /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/
action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
        from /Users/atmorell/Sites/blog/vendor/plugins/hobo/dryml/lib/dryml/
template_environment.rb:248:in `new_context'
        from /Users/atmorell/Sites/blog/vendor/plugins/hobo/dryml/lib/dryml/
template_environment.rb:255:in `new_object_context'
        from /Users/atmorell/Sites/blog/vendor/plugins/hobo/dryml/lib/dryml/
template_environment.rb:326:in `_tag_context'
        from vendor/plugins/hobo/hobo/taglibs/rapid_generics.dryml:33:in
`collection'
        from app/views/categories/index.dryml:6:in `categories_part'
        from /Users/atmorell/Sites/blog/vendor/plugins/hobo/dryml/lib/dryml/
template_environment.rb:248:in `new_context'
        from /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/
action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
        from /Users/atmorell/Sites/blog/vendor/plugins/hobo/dryml/lib/dryml/
template_environment.rb:248:in `new_context'
        from app/views/categories/index.dryml:6:in `categories_part'
        from /Users/atmorell/Sites/blog/vendor/plugins/hobo/dryml/lib/dryml/
template_environment.rb:169:in `send'
        from /Users/atmorell/Sites/blog/vendor/plugins/hobo/dryml/lib/dryml/
template_environment.rb:169:in `refresh_part'
... 89 levels...
        from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/
mongrel.rb:64:in `process'
        from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:
159:in `process_client'
        from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:
158:in `each'
        from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:
158:in `process_client'
        from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:
285:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:
285:in `initialize'
        from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:
285:in `new'
        from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:
285:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:
268:in `initialize'
        from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:
268:in `new'
        from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:
268:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/
mongrel.rb:34:in `run'
        from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/
server.rb:111
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `gem_original_require'
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
31:in `require'
        from script/server:3>>



On May 4, 7:27 pm, atmorell <[email protected]> wrote:
> Hi,
>
> I had this problem for about a week now, and I am getting nowhere.
>
> On my index page I have added a form that updates a collection when
> submitted. Problem is that I get an error if the collection does not
> get's passed the objects directly - with="&Catgory.all"
>
>  <form with="&Category.new" update="categories"/>
>   <collection with="&Category.all" part="categories"/>
>
> I have confirmed that the @categories is set and valid. Further more I
> switch to hobo edge, but with no result.
>
> Any help is highly welcome.
>
> NoMethodError (undefined method `empty?' for #<Category:0x105a2ee18>):
>   vendor/plugins/hobo/hobo/lib/hobo/find_for.rb:48:in `method_missing'
>   vendor/plugins/hobo/hobo/taglibs/rapid_generics.dryml:34:in
> `collection'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:328:in
> `_tag_context'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:248:in
> `new_context'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:248:in
> `new_context'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:328:in
> `_tag_context'
>   vendor/plugins/hobo/hobo/taglibs/rapid_generics.dryml:33:in
> `collection'
>   app/views/categories/index.dryml:5:in `categories_part'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:248:in
> `new_context'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:248:in
> `new_context'
>   app/views/categories/index.dryml:5:in `categories_part'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:169:in
> `send'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:169:in
> `refresh_part'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:267:in
> `new_object_context'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:248:in
> `new_context'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:248:in
> `new_context'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:255:in
> `new_object_context'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:186:in
> `with_part_context'
>   vendor/plugins/hobo/dryml/lib/dryml/template_environment.rb:168:in
> `refresh_part'
>   vendor/plugins/hobo/hobo/lib/hobo/controller.rb:92:in
> `__instance_exec0'
>   vendor/plugins/hobo/hobo/lib/hobo/controller.rb:87:in `each'
>   vendor/plugins/hobo/hobo/lib/hobo/controller.rb:87:in
> `__instance_exec0'
>   vendor/plugins/hobo/hobo/lib/hobo/model_controller.rb:819:in
> `render'
>   vendor/plugins/hobo/hobo/lib/hobo/controller.rb:85:in
> `ajax_update_response'
>   vendor/plugins/hobo/hobo/lib/hobo/controller.rb:73:in
> `hobo_ajax_response'
>   vendor/plugins/hobo/hobo/lib/hobo/model_controller.rb:573:in
> `create_response'
>   vendor/plugins/hobo/hobo/lib/hobo/model_controller.rb:571:in
> `create_response'
>   vendor/plugins/hobo/hobo/lib/hobo/model_controller.rb:526:in
> `hobo_create'
>   app/controllers/categories_controller.rb:12:in `create'
>   vendor/plugins/hobo/hobo/lib/hobo/controller.rb:23:in `call'
>   vendor/plugins/hobo/hobo/lib/hobo/controller.rb:23:in
> `included_in_class'
>
> Rendered rescues/_trace (121.4ms)
> Rendered rescues/_request_and_response (3.6ms)
> Rendering rescues/layout (internal_server_error)
>
> Best regards
> Asbjørn Morell.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Hobo Users" 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 
> athttp://groups.google.com/group/hobousers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.

Reply via email to