Ah, useless is not the best choice of words. I like AS for doing full Admin stuff but limiting the scope of the retrievable records has been frustrating.
On Feb 1, 12:34 pm, Brian Cardarella <[email protected]> wrote: > @kenny > > Well, the point is to limit access to a company's set of users for > the company admin. This is a trivial thing in Rails and I'm not > certain why it has to be so difficult to do in ActiveScaffold. > > If AS depends upon my route then it might be useless for what I'm > doing. > > - Brian > > On Feb 1, 12:24 pm, Kenny Ortmann <[email protected]> wrote: > > > > > Well it depends... Active scaffold does some nice things for you out of the > > box... > > for instance > > > If you are on they users - partners page, > > > url/users/5/partners > > > and you have active scaffold configured for the partners controller, it will > > try to load only that users partners. > > > But if the out of the box stuff does not work the way you want it to you can > > define this method in your controller > > > protected > > def conditions_for_collection > > conditions = {:partner_id => current_user.id > > end > > > Your situation is a little different because you have a has_many :through > > relationship so you might have to tweak the conditions but you can get this > > to work. > > > On Mon, Feb 1, 2010 at 11:13 AM, Brian Cardarella > > <[email protected]>wrote: > > > > So I'm trying to replace some Admin stuff with ActiveScaffold. For > > > example, I have this in a particular controller: > > > > def index > > > @users = current_user.partner.users > > > end > > > > def show > > > @user = current_user.partner.users.find(params[:id]) > > > end > > > > Is there a way to replicate this behavior in AS? Everything I've read > > > points to no, that it will take into consideration all records instead > > > of a specific portion of records. Thoughts? > > > > - Brian > > > > -- > > > 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]<activescaffold%2bunsubscr...@go > > > oglegroups.com> > > > . > > > For 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.
