#2322: Featured products crash trying to get short product description

Type: BugItem Feature: ProductManagement Tags: colivre
ScheduledFor: 0.36.6 Assigned to: JoenioCosta Sites:  
Priority: 0 Status: Done  

Description of the bug

NoMethodError in Home#index

Showing app/views/blocks/featured_products.rhtml where line #17 raised:

undefined method `[]' for #<Enumerable::Enumerator:0xb3fd2b3c>

Extracted source (around line #17):

14:                 <div class="featured-product-text">
15:                   <h3><%= p.name %></h3>
16:                   <p class="featured-product-price"><%= float_to_currency(p.price) %></p>
17:                   <p class="featured-product-desc"><%= p.description.chars[0...50].to_s + '...' %></p>
18:                   <p><%= link_to _('See More'), product_path(p), :class => 'featured-product-link' %></p>
19:                 </div>
20:               </div>

Trace of template inclusion: app/views/shared/block.rhtml, app/views/layouts/application-ng.rhtml

RAILS_ROOT: /usr/share/noosfero

-- JoenioCosta -- 20 Mar 2012

Add comment
You need to login to be able to comment.
 

ActionItemForm edit

Title Featured products crash trying to get short product description
ActionItemType? BugItem
Priority 0
Tags colivre
Feature ProductManagement
Plugin
ResponsibleDevelopers JoenioCosta
ScheduledFor? 0.36.6
AffectsVersion?
Status Done
Ticket SAC:
Topic revision: r6 - 11 May 2012 - 00:47:27 - DanielaFeitosa

irc Talk with Devs Now!

 
Translations: English
Search on Docs:
   
ActionItem Search:

Copyright © 2007-2014 by the Noosfero contributors
Colivre - Cooperativa de Tecnologias Livres