Thanks. I was missing the map.resources to that model. I didn't add a helper and it still seems to work. In any case, this was a "manually" created model, instead of using the Rails script, so that's why it was missing for me.
Thanks again. On Jul 12, 8:40 pm, Frederick Cheung <[email protected]> wrote: > On Jul 13, 2:12 am, Nathan Beyer <[email protected]> wrote: > > > I have a simple controller that takes a request, looks up some data > > and then returns the results as either HTML orAtom. The HTML response > > works fine, but theAtomBuilderis blowing up with anundefined > >methoderrorthat I can't figure out. It seems to be failing when the > > ActiveRecord instance is passed to the 'entry'methodand it tries to > > build the URL via the 'polymorphic_url'method. There is no > > 'order_url'method, field or database column, so I'm at a loss. > > You've got an instance of order, so various bits of rails assume that > (by default) to link to that particular object the order_url helper > should be called. Usually you get this for free when you write > map.resources :orders in your routes file (although you don't have to > create the named route via resources) > > Fred > > > > >Errormessage -undefinedmethod`order_url' for #<ActionView::Base: > > 0x25e3560> > > Code snippet that's failing (line 7) - > > 4: > > 5: for order in @orders > > 6: > > 7: feed.entry(order) do |entry| > > 8: > > Stack trace of failure - > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > polymorphic_routes.rb:109:in `__send__' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ > > polymorphic_routes.rb:109:in `polymorphic_url' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_view/helpers/ > > atom_feed_helper.rb:189:in `entry' > > /Library/Ruby/Gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb: > > 134:in `call' > > /Library/Ruby/Gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb: > > 134:in `_nested_structures' > > /Library/Ruby/Gems/1.8/gems/builder-2.1.2/lib/builder/xmlbase.rb:58:in > > `method_missing' > > /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_view/helpers/ > > atom_feed_helper.rb:178:in `entry' > > > I'm running Ruby 1.8.6 on Mac OS X 10.5.7. Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

