#21 ✓resolved
Paul Davis

Generalizing the admin sub-site howto for more index pages

Reported by Paul Davis | April 20th, 2008 @ 08:05 AM

I used the steps in the admin sub-site howto to create a "vendor" (in my domain, not the Rails directory) subsite in my app.

I want to customize several index pages in the subsite by editing the taglib file app/views/taglibs/vendor.dryml, analogous to admin.dryml in the howto.

It work well when I don't need to specify which model's index page I am extending. This is the case in the howto and works fine for me:

<def tag="index-page" extend-with="vendor">

However, when I try to extend the index pages of two models distinctly, I get an error. I add a for= qualifier to my tag extension:

<def tag="index-page" for="Instrument" extend-with="vendor">

when I do this, I get this error when I view the instruments index page:

NameError in Vendor/instrumentsController#index

undefined method `index_page__for_instrument' for class `#'

Note the double underscore separating the words "page" and "for". I am tempted to think this is a Hobo error, particularly when I read the source for Hobo's alias_method_chain and note that it is in a directory called "fixes"

It's also quite possible I have cribbed the syntax from an irrelevant example, in which case I am happy to be corrected.

Thanks for any insight either way!

Paul

Comments and changes to this ticket

  • Paul Davis

    Paul Davis April 20th, 2008 @ 08:05 AM

    • Title changed from “ Generalizing the admin sub-site howto for more index pages” to “Generalizing the admin sub-site howto for more index pages”
  • Tom Locke

    Tom Locke April 21st, 2008 @ 01:58 PM

    • State changed from “new” to “resolved”

    Please see updates to the how-to related to specific index-pages (right at the end)

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages