On Sat, Jan 8, 2011 at 1:57 PM, Kevin Monk <ke
...@mangoswiss.com> wrote:
> THanks Shaun.
> The more I look at some of the other posts on here, the more I
> realised that assigning multiple global roles to a single user
> probably wasn't going to do me much good.
> I ended up just changing to a single global role per user and then
> creating make_admin and remove_admin routes and associated controller
> actions and then only only allow access to those methods for admins.
> It seems to be a recurring theme that if I've got stuck on something
> it's normally because I have the structure a little skewy. Not always
> easy to see where you're making a fundamental miscomprehension though
> I guess.
> On Jan 8, 5:39 pm, Shaun Gish <sh...@figarointeractive.com> wrote:
> > Here's what I ended up doing:
> > http://rails.pastebin.com/N8V3QWjy
> > Basically I ended up defining a custom getter/setter... not sure if this
> is
> > the right way or best way to do it but it worked for me
> > On Sat, Jan 8, 2011 at 10:37 AM, Kevin Monk <ke...@mangoswiss.com>
> wrote:
> > > I'm having the same issue except I'm wishing to use a check_box for
> > > the roles.
> > > At the moment I have something that looks a little like this...
> > > - fields_for @user do |user_form|
> > > - user_form.fields_for :assign_roles do |role_form|
> > > - Role::POSSIBLE_ROLES.each do |role|
> > > %p
> > > = role_form.check_box role, :checked => @user.has_role?(role)
> > > = role_form.label role.humanize
> > > but when I do this then in the params hash I get something like
> > > this....
> > > "assign_roles"=>{"super_administrator"=>"0", "administrator"=>"1"}
> > > Was hoping I could use the standard @user.update_attributes by making
> > > my filelds_for :roles
> > > but that's not helping me too much.
> > > Would be interested to know where you got to with it.
> > > On Jan 7, 9:49 pm, Shaun <shaung...@gmail.com> wrote:
> > > > I have searched everywhere and tried to find an example of using ACL9
> > > > to generate a select form for use in a new user form. Is there any
> > > > place that I can find an example of a view and controller that have a
> > > > "role select" implementation?