Hello
class PlanOperativo < ActiveRecord::Base
  hobo_model # Don't put anything above this
  fields do    cant :decimal    timestamps  end    belongs_to :indicador  
belongs_to :proyecto
------in app/views/proyectos/show.dryml <show-page>  <after-collection:>    
Total: <view field="plan_operativos.sum(:cant)" />  
</after-collection:></show-page>

showme the next errorTypeError in Proyectos#showShowing 
/home/quike/pr/simo/app/views/proyectos/show.dryml where line #3 raised:can't 
convert String into Integer
can use a <table-plus>  with total sum ? on one o many columns_?
RegardsEnrique
Date: Tue, 16 Aug 2011 15:32:56 -0700
From: [email protected]
To: [email protected]
Subject: Re: RE: [Hobo Users] Re: FW: Sum a atributte on collection tag Not 
ideas?

Given your data, looks like you don't need to customize the collection.  Just 
add the view tag below it.

On a side note, you might want to take look through the dryml guide at some 
point as copying the whole show-page def isn't the dryest way to proceed. 
http://cookbook.hobocentral.net/manual/dryml-guide  You can extend the tag 
instead and just replace/add the bits you need to change.  By the way, this is 
not a requirement, just a suggestion that will make dryml pleasanter to work 
with in the long run.

As an example, if adding the sum is the only change to make you could do:

<extend tag="show-page" for="Proyecto">
  <old-show-page merge>
    <after-collection:>
      Total: <view field="plan_operativos.sum(:cant)" />
    </after-collection:>
  </old-show-page>
</extend>

Or even add app/views/proyectos/show.dryml if this is your only show-page for 
proyecto:

<show-page>
  <after-collection:>
    Total: <view field="plan_operativos.sum(:cant)" />
  </after-collection:>
</show-page>




-- 

You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.

To view this discussion on the web visit 
https://groups.google.com/d/msg/hobousers/-/zIBJoGQOi10J.
 
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.
                                          

-- 
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