Table plus fliter

22 views
Skip to first unread message

Javier V

unread,
Aug 1, 2011, 11:26:08 PM8/1/11
to Hobo Users
Hi everybody. I have a table plus view with 2 data base tables.
Actually I display a list of computers with the last event, but I have
a lot of equipment register and not necessarily it has an event. I
need to display only the computers with an event registered. can you
help me pleas? If there is a post with domething similar pleas let me
know.

Thank you
Javier V

Quiliro Ordóñez

unread,
Aug 1, 2011, 11:43:43 PM8/1/11
to hobo...@googlegroups.com
El 01/08/11 22:26, Javier V escribi�:

Will you please show us the code?

--
Quiliro Ord��ez
09 821 8696
02 340 1517
"No se puede sacrificar la libertad por ning�n bien, por ninguna promesa
de pan o de paz o de justicia, porque ese pan tendr�a amargura de
veneno, esa paz ser�a de muerte, y esa justicia no ser�a justicia humana
ni tendr�a sentido." Alfredo P�rez G.

kevinpfromnm

unread,
Aug 2, 2011, 12:16:36 PM8/2/11
to hobo...@googlegroups.com
I believe if you include the events on your find, it will not grab items without events.

Javier V

unread,
Aug 3, 2011, 2:47:14 PM8/3/11
to Hobo Users
This is my code, from the view and controller:

<index-page>
<collection: replace>

<table-plus
fields="this,status,employee,last_event,last_upload_at,updated_at">
<last_upload_at-view:><view format="%D %H:%M:%S"/></last_upload_at-
view:>
<updated_at-view:><view format="%D %H:%M:%S"/></updated_at-view:>

</table-plus>
</collection:>
</index-page>


class EquipmentController < ApplicationController

hobo_model_controller

auto_actions :all

def index
scopes = {:order_by =>
parse_sort_param(:name,:last_upload_at,:update_at)}
hobo_index Equipment.apply_scopes(scopes), :order => "name DESC"
end

end

Thank you for the help

Javier V

unread,
Aug 3, 2011, 2:48:14 PM8/3/11
to Hobo Users
How i can do that?

Tahnkyou for your time

kevinpfromnm

unread,
Aug 4, 2011, 12:14:49 PM8/4/11
to hobo...@googlegroups.com
add :include => :events to the end of your hobo_index call

Javier V

unread,
Aug 10, 2011, 12:06:56 PM8/10/11
to Hobo Users
Thank you, I'll try this
Reply all
Reply to author
Forward
0 new messages