Can you try it with a new controller first - named for the view? That 
will make sure that all the database permissions on the view, naming, 
pluralization etc is properly set up. I don't think ActiveScaffold 
distinguishes between tables and views so it shouldn't have a problem.

If that works then having a separate controller for the report might be 
the easiest solution. If you want to intermingle them this is quite a 
bit more work. Since views are read-only you will have have to override 
activescaffold's CRUD actions as described below. Plus you forevermore 
will have to keep them in sync.

Regards,
Kerry

joelm wrote:
> Hi-
>
> A year ago, you gave this reply to the ActiveScaffold group.  I'm
> emailing since I don't know if you'd see an update to such an old
> thread.
> Anyway, I tried to follow your advice, created a view and created an
> model for the view.  (The model is empty for now, no
> associations. )
> But when I point my controller at the new model I get:
>
> Mysql::Error: #42S02Table
> 'rgame_development.view_report_grouping_titles' doesn't exist: SHOW
> FIELDS FROM `view_report_grouping_titles`
>
> It seems that with MySql ActiveScaffold can't use a view
> interchangeably with a table.
>
> (The problem I'm really trying to solve is that I want to do a 'group
> by' in my data before reporting, so my plan was to use
> a view to setup the groupby since AS doesn't allow us to pass
> in :group as part of the query.)
>
> Thanks for any advice!
>
> Joel
>
> On Sep 8 2007, 1:11 am, Bonefish <[EMAIL PROTECTED]> wrote:
>   
>> To clarify - that's to get to has_many associations of a parent
>> record.  If it's just a belongs to on the parent then you can get to
>> that with a virtual column.
>>
>> On Sep 7, 2:07 pm, Bonefish <[EMAIL PROTECTED]> wrote:
>>
>>     
>>> I think the only way to do that would be adatabaseviewof the parent
>>> and it's associations so that the association data becomes
>>> denormalized.  Then the association data can be accessed simply via a
>>> virtual column (since it's now just a column of the parent).  Of
>>> course then you'd need different classes for reading versus updating
>>> the data and/or have to do some behind the scenes class substitution
>>> in the CRUD actions.  Use theviewclass for list and show but the
>>> real parent for create and update.
>>>       
>>> On Sep 7, 1:35 pm, Robin <[EMAIL PROTECTED]> wrote:
>>>       
>>>> Cool. So, is there a way to do this in the case of belongs_to (we
>>>> can't do belongs_to :through right?)
>>>>         
>
>   

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to