OK. Done a little debugging, and something is definetly up.
Seeing as object_url is unhappy, I added this:
if obj.respond_to?(:member_class) && obj.respond_to?(:origin)
# Asking for URL of a collection, e.g. category/1/adverts or
category/1/adverts/new
logger.warn obj.inspect
logger.warn obj.origin.inspect
logger.warn obj.origin.class.inspect
obj, it turns out, is an array of items. Not a single new item as it
should be.
This is problematic, as it has no origin (w.e. that is), and this code
assumes that if it responds to origin, origin will not be nil.
Its also problematic because it shouldn't be an array.
`new_for_current_user(Item)` from the index page for item is the top
of the stack, and it looks like somewhere along the way table plus is
sending a bullet train through a red light.
--Peter
On Nov 6, 9:08 pm, Owen Dall <[email protected]> wrote:
> A while back there was an issue requiring all *extend *tags to be in *
> appplication.dryml.* May be a red herring, my memory is not clear on this.
>
> Matt or Bryan would be a better resource : -)
>
> On Sat, Nov 6, 2010 at 7:37 PM, Peter Ehrlich
> <[email protected]>wrote:
>
>
>
>
>
>
>
>
>
> > Works fine: without extending tag. Works fine: not having table-plus.
>
> > Breaks:
> > <extend tag="form" for="Item">
> > <old-form/>
> > </extend>
>
> > Works:
> > <extend tag="form" for="Item">
>
> > </extend>
>
> > Trace:http://localhost:3000/items
> > undefined method `reverse_reflection' for NilClass:Class
>
> > Extracted source (around line #3):
>
> > 1: <index-page>
> > 2: <collection: replace>
> > 3: <table-plus fields="this, pack_size, notes">
> > 4: <!--<table-plus>-->
> > 5: <empty-message:>No matches among item name or sku</empty-
> > message:>
> > 6: </table-plus>
>
> > /Users/peter/.rvm/gems/ruby-1.8.7-p...@rails238b/gems/hobo-1.0.1/lib/
> > hobo/hobo_helper.rb:64:in `object_url'
> > /Users/peter/.rvm/gems/ruby-1.8.7-p...@rails238b/gems/hobo-1.0.1/
> > taglibs/rapid_forms.dryml:171:in `form__base'
> > /Users/peter/.rvm/gems/ruby-1.8.7-p...@rails238b/gems/hobo-1.0.1/lib/
> > hobo/dryml/template_environment.rb:328:in `_tag_context'
> > /Users/peter/.rvm/gems/ruby-1.8.7-p...@rails238b/gems/hobo-1.0.1/lib/
> > hobo/dryml/template_environment.rb:248:in `new_context'
> > /Users/peter/.rvm/gems/ruby-1.8.7-p...@rails238b/gems/actionpack-2.3.8/
> > lib/action_view/helpers/capture_helper.rb:129:in `with_output_buffer'
> > /Users/peter/.rvm/gems/ruby-1.8.7-p...@rails238b/gems/hobo-1.0.1/lib/
> > hobo/dryml/template_environment.rb:248:in `new_context'
> > /Users/peter/.rvm/gems/ruby-1.8.7-p...@rails238b/gems/hobo-1.0.1/lib/
> > hobo/dryml/template_environment.rb:328:in `_tag_context'
> > /Users/peter/.rvm/gems/ruby-1.8.7-p...@rails238b/gems/hobo-1.0.1/
> > taglibs/rapid_forms.dryml:151:in `form__base'
> > /Users/peter/.rvm/gems/ruby-1.8.7-p...@rails238b/gems/hobo-1.0.1/lib/
> > hobo/dryml/template_environment.rb:464:in `send'
> > /Users/peter/.rvm/gems/ruby-1.8.7-p...@rails238b/gems/hobo-1.0.1/lib/
> > hobo/dryml/template_environment.rb:464:in `override_and_call_tag'
> > /Users/peter/.rvm/gems/ruby-1.8.7-p...@rails238b/gems/hobo-1.0.1/lib/
> > hobo/dryml/template_environment.rb:427:in `call_tag_parameter'
> > app/views/taglibs/auto/rapid/forms.dryml:16:in
> > `form__for_item_without_a5d54cc8e896'
> > app/views/taglibs/auto/rapid/forms.dryml:15:in
> > `form__for_item_without_a5d54cc8e896'
> > app/views/taglibs/application.dryml:76:in `form__for_item'
> > app/views/taglibs/application.dryml:75:in `form__for_item'
> > app/views/items/index.dryml:3:in `render_page'
> > app/views/items/index.dryml:2:in `render_page'
> > app/views/taglibs/auto/rapid/pages.dryml:163:in `index_page__for_item'
> > app/views/taglibs/auto/rapid/pages.dryml:159:in `index_page__for_item'
> > app/views/taglibs/auto/rapid/pages.dryml:159:in `index_page__for_item'
> > app/views/taglibs/auto/rapid/pages.dryml:144:in `index_page__for_item'
> > app/views/taglibs/themes/clean/clean.dryml:2:in
> > `page_without_a212d1acd74f'
> > app/views/taglibs/themes/clean/clean.dryml:1:in
> > `page_without_a212d1acd74f'
> > app/views/taglibs/application.dryml:12:in `page'
> > app/views/taglibs/application.dryml:11:in `page'
> > app/views/taglibs/auto/rapid/pages.dryml:141:in `index_page__for_item'
> > app/views/taglibs/auto/rapid/pages.dryml:140:in `index_page__for_item'
> > app/views/items/index.dryml:1:in `render_page'
> > app/views/items/index.dryml:1:in `render_page'
>
> > gak. blork. bug. ack. oh noes. weep.
>
> > --Peter
>
> > On Nov 6, 6:40 pm, Matt Jones <[email protected]> wrote:
> > > Can you post a full stack trace? It'll be a lot easier to figure out...
>
> > > Thanks,
>
> > > --Matt Jones
>
> > > On Nov 5, 2010, at 11:06 PM, Peter Ehrlich wrote:
>
> > > > replacing a table with a table-plus causes an error if <old-form/> is
> > > > used in extended form tag:
> > > > "undefined method `reverse_reflection' for NilClass:Class".
>
> > > > Something is set up wrong, somewhere in my app.
>
> > > > Some more verbose. My tag extension:
>
> > > > <extend tag="form" for="Item">
> > > > <old-form/>
> > > > </extend>
>
> > > > My index page:
> > > > <index-page>
> > > > <collection: replace>
> > > > <table-plus>
> > > > <empty-message:>No matches among item name or sku</empty-message:>
> > > > </table-plus>
> > > > </collection:>
> > > > </index-page>
>
> > > > My model associations:
>
> > > > class Item < ActiveRecord::Base
> > > > # ...
> > > > has_many :variants, :class_name => "ItemSupplier", :accessible =>
> > > > true, :dependent => :destroy
> > > > has_many :lineitems, :class_name => "OrderItems", :dependent
> > > > => :destroy
>
> > > > has_many :suppliers, :through => :variants
>
> > > > Not really familiar with the error, and all my associations and
> > > > reverse associations look ok. What's it mean?
>
> > > > --
> > > > 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]<hobousers%2bunsubscr...@googlegroups
> > .com>
> > .
> > > > 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]<hobousers%2bunsubscr...@googlegroups
> > .com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/hobousers?hl=en.
>
> --
> Thanks,
>
> Owen
>
> Owen Dall, Chief Systems Architect
> Barquin Internationalwww.barquin.com
> Cell: 410-991-0811
--
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.