Browse the Ruby on Rails Community.

You are here: Forums Ask a Rails expert "Report by" best practice...

Replytotopic

"Report by" best practice

Posted in Forums : Ask a Rails expert

 
Profile

Authority 50
Posting Rating 0
Sign in to rate this post

Hi folks,

today I ran into a difficult design issue and I would like to hear some experts on how this is done in the most elegant way.

We are building databases for development aid projects, which can be categorized by things like their donor, their location in the country, their “DAC-CRS Sector” or to which Millenium Development Goals they apply. Don’t think too hard about this, it’s not relevant. ;-)

Now I want to create reports like this one: http://odatest.hacksrus.net/reports/donors.

As you can see in the first generation of my application I haven’t thought too much about the issue and just created a reports controller which donor/mdg/location/sector methods for each of the reports.

However that is neither DRY to me, nor does it really fit into a RESTful application.

My idea was to use nested resources and, in the projects controller’s list action, check whether :donor_id or mdg_id etc. has been supplied.
That would work for the actual reports, but not for the overview pages that list the number of projects per donor, provide the links etc.

I hope someone can come up with a better idea, this is really driving me nuts.

Cheers

Pascal

Replytotopic

Other Recent Topics

Ask a Rails expert : How to parse <pubdate> in RSS

Ask a Rails expert : Couldn't find Product without an ID

Ask a Rails expert : HTML to XML ---> get title & description

Ask a Rails expert : Accessing controller actions from scripted page?

Ask a Rails expert : seledted option for select_tag

Ask a Rails expert : Merging fields from two tables into one, including duplicates

Ask a Rails expert : saving has_many :through

Ask a Rails expert : Use Rails to develop sites for both Designer and Programmer

Ask a Rails expert : Rails+RS232

Ask a Rails expert : Is this a good way to add Admin section

Formatting Help
  • *bold*       _italics_      
    bq. (quotes)
  • "DSC":http://www.dsc.net
  • * or # (lists)
or cancel