ruby on rails - Undefined method `title' for nil:NilClass in atom_feed -
disclaimer: i'm very new ruby on rails.
here error getting when attempting generate feed:
undefined method `title' nil:nilclass
extracted source (around line #2):
atom_feed |feed| feed.title "who bought #{@product.title}" feed.updated @latest_order.try(:updated_at)
application trace:
app/views/products/who_bought.atom.builder:2:in `block in _app_views_products_who_bought_atom_builder__3166274680323093135_70240865825480' app/views/products/who_bought.atom.builder:1:in `_app_views_products_who_bought_atom_builder__3166274680323093135_70240865825480'
this first time working atom_feed - not sure here. have appears straight book "agile web development rails 4" missing something?
should be:
coding :
before_action : set_product, only: [:show, :edit, :update, :destroy, :who_bought]
Comments
Post a Comment