Showing /home/quike/pr/simo/app/views/proyectos/show.dryml where line #3 raised:
can't convert String into IntegerHi Enrique,
This is a bit offtopic, but I find your emails almost impossible to
read, like the newlines are not working. I also tried visiting the
Google Groups interface to check if my Thunderbird has gone crazy, but
the problem remains.
Could you please check your newline settings? It would really help for
the readibility of your emails :)
Regards,
Ignacio
El 17/08/11 01:02, Enrique Moreira escribi�:
>
> 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: kevinp...@gmail.com
> To: hobo...@googlegroups.com
> 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>
>
>
>
>
- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk5Tz0oACgkQBPlUJ6RHaORRtQCgt9cTmbBPfeONeXBBRVOBpVYt
c2QAoLkc1KdKcXWbK+4P79Qubr2HtOQM
=xauk
-----END PGP SIGNATURE-----
Mmm, I also work with Ubuntu and Gedit and haven't seen that problem
copying and pasting...
Anyway, this last email was much more readable, thanks!
Regards,
Ignacio
El 23/08/11 18:12, Enrique Moreira escribi�:
- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk5T0zYACgkQBPlUJ6RHaOQ1HACfQYOZ6sAW5wiNGLuBUWItKn5h
aVMAn3zecUgS4fyI4ab/c1h1r+iTPyiN
=dhin
-----END PGP SIGNATURE-----
Hi Enrique,
Why don't you try to make a virtual field in the PlanOperativo model and
sum it there?
def total
progreso_indicadors.sum(:cant)
end
And later you can call the table-plus:
<table-plus fields="total"/>
or maybe you just want something more simple:
<this.total/>
About using custom Ajax forms to make a query and return a result I
recommend you this manual: http://cookbook.hobocentral.net/manual/ajax.
Ajax is a bit crazy when you start but with a lot of Firebug and
patience you can certainly make it :)
Regards,
Ignacio
El 23/08/11 18:49, Enrique Moreira escribi�:
>
> Hello Ignacio
> this is mi trouble:i have a tree tables
> Proyectos.rb proyecto:string--has_many: plan_operativos-----------------------Plan_operativo.rb fecha:date cant:decimal--belongs_to: proyectohas_many: progreso_indicador
> --------------------------------------
> Progreso_indicador.rb fecha:date cant:decimal--- belongs_to: plan_operativo
> i put the next lines on application.dryml:----------------------------<def tag="card" for="PlanOperativo"><card class="plan-operativo" param="default" merge><header: param> <h4 param="heading"><a><name/></a> : <view:cant/> : [<view:indicador.unidadcl.unidad/>]</h4> </header:><body: param><ht key="progreso_indicador.collection.count" count="&this.progreso_indicadors.size"><count:progreso_indicadors param/></ht><div><table-plus:progreso_indicadors fields="this,cant" without-search-form><progreso_indicador-heading:>Fecha</progreso_indicador-heading:><cant-heading:>Cantidad</cant-heading:></table-plus> <div>total: <!--<table-plus fields="progreso_indicadors.sum(:cant)"/> --> <---HOW TO SUM_? shoeme error cant convert string to integer!! </div> </div> </body:> </card></def>-------------------------
> The render works fine!
> a) i need a sum of Progreso_indicadors.cantb) -- between dates? put two select dates ?
> c) One New Form with Nested Select Boxes..ajax style? alternatively? -Select Proyects 1- Select Plan_Operativos One or Selected Plans [x] checkboxes? or / and 2-Select dates Ranges or ALL 3. Display a table-plus with SUM results on bottom
>
> Any idea?
> Best Regards Enrique
>
>
>
- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk5WgsYACgkQBPlUJ6RHaOS6pgCfQhkk15mndgJvO64KSpMUzZOk
nPcAn0Xk1TLo/cXvH/kPUrSF6RbIIFOo
=GGxL
-----END PGP SIGNATURE-----
This is not stricly about Hobo. I recommend you read some of the theory
behind the Model-View-Controller in Rails, I think it can help you.
For example, you can make customise the Hobo show action in the
controller, something like this:
def show
@records = Model.find(:all, :conditions => "date > '2011-01-01'")
@amount = @records.sum(:cant)
hobo_show
end
And then you have access to @amount in the view :).
Regards,
Ignacio
El 25/08/11 21:16, Enrique Moreira escribi�:
>
> Hello Ignacio
> Yes. Its works Fine!! Thanks! sum very wellnow one question more please:
> The model:
> ProgresoIndicators.rbfecha:datecant:decimal---How to select a range of dates ? on the View?? to sum cant partialuse two select dates put on the View of Plan_operativo?
> Regards
> Enrique
>
>
>> Date: Thu, 25 Aug 2011 19:13:44 +0200
>> From: ign...@ihuerta.net
>> To: hobo...@googlegroups.com
>> Subject: Re: [Hobo Users] Re: FW: Sum a atributte on collection tag Not ideas?
>>
> Hi Enrique,
>
> Why don't you try to make a virtual field in the PlanOperativo model and
> sum it there?
>
> def total
> progreso_indicadors.sum(:cant)
> end
>
>
> And later you can call the table-plus:
>
> <table-plus fields="total"/>
>
> or maybe you just want something more simple:
>
> <this.total/>
>
>
>
> About using custom Ajax forms to make a query and return a result I
> recommend you this manual: http://cookbook.hobocentral.net/manual/ajax.
> Ajax is a bit crazy when you start but with a lot of Firebug and
> patience you can certainly make it :)
>
>
> Regards,
> Ignacio
>
> El 23/08/11 18:49, Enrique Moreira escribi�:
>>>>
>>>> Hello Ignacio
>>>> this is mi trouble:i have a tree tables
>>>> Proyectos.rb proyecto:string--has_many: plan_operativos-----------------------Plan_operativo.rb fecha:date cant:decimal--belongs_to: proyectohas_many: progreso_indicador
>>>> --------------------------------------
>>>> Progreso_indicador.rb fecha:date cant:decimal--- belongs_to: plan_operativo
>>>> i put the next lines on application.dryml:----------------------------<def tag="card" for="PlanOperativo"><card class="plan-operativo" param="default" merge><header: param> <h4 param="heading"><a><name/></a> : <view:cant/> : [<view:indicador.unidadcl.unidad/>]</h4> </header:><body: param><ht key="progreso_indicador.collection.count" count="&this.progreso_indicadors.size"><count:progreso_indicadors param/></ht><div><table-plus:progreso_indicadors fields="this,cant" without-search-form><progreso_indicador-heading:>Fecha</progreso_indicador-heading:><cant-heading:>Cantidad</cant-heading:></table-plus> <div>total: <!--<table-plus fields="progreso_indicadors.sum(:cant)"/> --> <---HOW TO SUM_? shoeme error cant convert string to integer!! </div> </div> </body:> </card></def>-------------------------
>>>> The render works fine!
>>>> a) i need a sum of Progreso_indicadors.cantb) -- between dates? put two select dates ?
>>>> c) One New Form with Nested Select Boxes..ajax style? alternatively? -Select Proyects 1- Select Plan_Operativos One or Selected Plans [x] checkboxes? or / and 2-Select dates Ranges or ALL 3. Display a table-plus with SUM results on bottom
>>>>
>>>> Any idea?
>>>> Best Regards Enrique
>>>>
>>>>
>>>>
>
>>
- --
You received this message because you are subscribed to the Google
Groups "Hobo Users" group.
To post to this group, send email to hobo...@googlegroups.com.
To unsubscribe from this group, send email to
hobousers+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.
>>
- --
Ignacio Huerta Arteche
http://www.ihuerta.net
Tel�fono: 0034 645 70 77 35
Email realizado con software libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk5XOy8ACgkQBPlUJ6RHaOSuaQCeMSX8K3sPS4P8shdLccr6qe5D
zgcAoIfJzgD2GePDkiakDVJcuShg48Sg
=Qm0H
-----END PGP SIGNATURE-----