hobo_index - turn pagination OFF

31 views
Skip to first unread message

Mikkel WF

unread,
Feb 3, 2010, 11:37:41 AM2/3/10
to Hobo Users
How can i turn pagination off in an hobo_index..?

When i apply the "hobo_index :paginate => false" to my index
controller, i get an "undefined method `total_pages' for #<Array:
0x106511fb0>" error, like the view still expects a pagination to
occur...

What to do..?

Matt Jones

unread,
Feb 3, 2010, 11:53:36 AM2/3/10
to hobo...@googlegroups.com

The autogenerated page doesn't know that you've turned off pagination
in the controller. You can either write your own index view, or just
add a view hint:

paginate? false

to the file in app/viewhints/ corresponding to your model.

@Tom, Bryan: would it make sense to harden the page-nav tag against
this kind of thing, to make the automatic index-page tag more useful?
Either that, or we should be checking the viewhint in
find_or_paginate, but it seems silly to have to switch one option off
in two spots.

--Matt Jones

Mikkel WF

unread,
Feb 3, 2010, 12:20:14 PM2/3/10
to Hobo Users
Okay, first of all thx, it works..!

second, i should have mentioned that i was working on the user model,
and there i can't get i to work. The view generation is not affected
by the user.hints.rb file i've created (but i suspect it's because the
user model is not a standard hobo model!?)

Where in the page dryml is the pagination declared. Can't seem to find
it in the rapid pages.dryml file.

kevinpfromnm

unread,
Feb 3, 2010, 1:03:57 PM2/3/10
to Hobo Users
IMHO I'd say yes, either that or a better error.

I've run into similar things modifying controller code for an index
page and it's not clear at first what just broke other than the magic
hobo index method does something yours doesn't.

Bryan Larsen

unread,
Feb 3, 2010, 1:15:33 PM2/3/10
to hobo...@googlegroups.com

Mikkel WF

unread,
Feb 3, 2010, 1:23:44 PM2/3/10
to Hobo Users
Super..

I managed to get it working with this code in the index.dryml

<index-page>
<content-body:>
<table-plus fields="this, administrator?"/>
</content-body:>
</index-page>


On 3 Feb., 19:15, Bryan Larsen <bryan.lar...@gmail.com> wrote:
> ticket created:https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/621-harden-...

Reply all
Reply to author
Forward
0 new messages