[LRUG] Setting default roles in a user record

Pratik Naik pratik at thinkwares.com
Tue Aug 7 08:05:54 PDT 2007


after/before_create would work fine. But let's say if you have an
action called new() and in form you have a selection box for roles -
you will need to have something else for having default roles selected
in selection box.

On 8/7/07, Tim Cowlishaw <tim at timcowlishaw.co.uk> wrote:
> Hmm... thinking about it, wouldn't after_create do the job? i'm assuming
> that after_initialize  is called whenever a new object of that class is
> instantiated, whether through a new(), find() or whatever method on the
> model. after_create is called after a new object of that class is created
> through new().
>
> http://groups.google.com/group/rubyonrails-core/browse_thread/thread/b509a2fe2b62ac5
> http://api.rubyonrails.com/classes/ActiveRecord/Callbacks.html
>
> Cheers,
>
> Tim
>
> On 8/7/07, Daniel Lucraft < dan at fluentradical.com> wrote:
> >
> > --- John Winters < john at sinodun.org.uk> wrote:
> > > Actually, not so brilliantissimum.  I thought it
> > > worked when I first
> >
> > Crapsicle. Thought I had it there.
> >
> > ps. Making up words is fun.
> > _______________________________________________
> > Chat mailing list
> > Chat at lists.lrug.org
> > http://lists.lrug.org/listinfo.cgi/chat-lrug.org
> >
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>



More information about the Chat mailing list