Actually, I think I found some "magic"!

In my controller I use:

  def show
    @collection = find_instance
    @books =
      @collection.books.apply_scopes(:search => [params
[:search], :title, :author, :id],
                                     :order_by => parse_sort_param
(:title, :author)).paginate(:per_page => 30, :page => params[:page])
  end

In my "show_page.dryml" I then use:
<show-page>
        <collection: replace>
        <page-nav with="&@books"/>
                <table-plus with="&@books" fields="this, author, id,
inv_location">
                <empty-message:>No books for search criteria</empty-message:>
                </table-plus>
        <page-nav with="&@books"/>
        </collection:>
</show-page>

Seems to work great and puts the pagination right into the show form
for the child table. Hobo is awesome, I just wish it had a bit more
documentation.

 - Mike


On Jun 19, 11:58 am, kevinpfromnm <[email protected]> wrote:
> To add paging to a show page means modifying controller and view.  You
> need to select a subset of your join (assuming it's a has_many join
> model) for your view and process a paging parameter in the
> controller.  Usually you'd group the two there in the controller, set
> a variable for the resulting set and use that variable to show your
> table.
>
> This is unless there's been some magic way added to be able to
> accomplish this task that I haven't found out about...
>
> On Jun 18, 2:23 pm, oldlibmike <[email protected]> wrote:
>
>
>
> > I was able to put a nice table-plus in a show page for my application,
> > but the table shows every row for the currently selected record
> > without any pagination. I see a page-nav parameter mentioned in the
> > tag library but I don't know how to set a value.
>
> > Is there an easy way to force the table to page every x rows?
> > I checked the tutorials but I can't find an example.
>
> > Thanks,
> >  Mike
--~--~---------~--~----~------------~-------~--~----~
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