I recently tried this but there is one issue with it.

The embedded ActiveScaffold uses pagination and I haven't found a good
way to disable it. I've tried setting :per_page to a ridiculously high
number. And when I click the "Next" link, it tries to call the show
action which is actually disabled for the ActiveScaffold that I'm
embedding.  >_<

- Enrico


On Aug 5, 3:51 pm, Jamie Briggs <[email protected]> wrote:
> I had this problem as well.
>
> What Kenny Ortmann said though, suggested the solution.  Put a ":params => { 
> :limit => 5 }" into your render parameter list.  Mine looks like:
>
>      <%= render :active_scaffold => 'afiles', 
>              :label => '',
>              :params => { :limit => 5 },
>              :constraints => { :action_id => @unpack_id } %>
>
> That did the trick for me.
>
> - Jamie
>
>
>
> ----- Original Message -----
> From: Enrico Bianco <[email protected]>
> Date: Friday, July 31, 2009 1:06 pm
> Subject: Re: Limiting the number of rows for an embedded ActiveScaffold
> To: "ActiveScaffold : Ruby on Rails plugin" <[email protected]>
>
> > I am embedding an ActiveScaffold into another (non-AS) controller
> > action.
>
> > So when I call render :active_scaffold => "controller_name" ... and
> > such, I want to be able to set at limit for the number of items that
> > show up.
>
> > - Enrico
>
> > On Jul 29, 12:16 pm, Kenny Ortmann <[email protected]> wrote:
> > > What exactly are you trying to do?
>
> > > If you go to an active scaffold controller and in the browser
> > go to the url
> > > and put ?limit=1 at the end does it not limit the list view to
> > 1 item?
>
> > > On Mon, Jul 27, 2009 at 10:34 AM, Enrico Bianco
> > <[email protected]> wrote:
>
> > > > Hi all,
>
> > > > Is there a way to limit the number of rows that appears in
> > an embedded
> > > > scaffold?
>
> > > > I want to show only the most recent couple of items in a
> > list to the
> > > > user but passing :limit to the render :active_scaffold call
> > doesn't> > seem to work. So doesn't :per_page.
>
> > > > Thanks,
> > > > Enrico
> > --~--~---------~--~----~------------~-------~--~----~
> > 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] more options,
> > visit this group at
> >http://groups.google.com/group/activescaffold?hl=en-~----------~-
> > ---~----~----~------~----~------~--~---
--~--~---------~--~----~------------~-------~--~----~
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