Re: [Rails] Re: Relational DB - Related and not Related

2013-06-26 Thread Colin Law
On 26 June 2013 02:55, Cameron Gilroy wrote: > Here is an update, I have it working as only a group or as only a non-group > user. I have below the create controller and was wondering what would be the > best way to allow associations and non-associated records. Thanks > > def create > if Gr

Re: [Rails] Re: Relational DB - Related and not Related

2013-06-26 Thread Dave Aronson
On Tue, Jun 25, 2013 at 9:55 PM, Cameron Gilroy wrote: > respond_to do |format| > if @user.save && @user.group_id == nil > format.html { redirect_to "/", notice: 'Thank you for registering!' > } > elsif @user.save && @user.group_id != "" > format.html { redirect_to

[Rails] Re: Relational DB - Related and not Related

2013-06-25 Thread Cameron Gilroy
Here is an update, I have it working as only a group or as only a non-group user. I have below the create controller and was wondering what would be the best way to allow associations and non-associated records. Thanks def create if Group.nil? @group = Group.find(params[:group_id])

[Rails] Re: Relational DB - Related and not Related

2013-06-24 Thread Cameron Gilroy
Thanks Dave & Colin! That was how I had hoped it would work! On Monday, June 24, 2013 10:54:14 PM UTC+10, Cameron Gilroy wrote: > > Hi > > I'm working on a project that has users and groups, users can be members > of a group *or* they can just be a user - what's going to be the best way > to dea