Re: [Rails] Adding a site admin user while creating a site

2011-11-10 Thread Siva Prasad
Sorry Now i got it. you meant to say read each user object from the @site.users and operate on them. thanks a lot :-) On 11/10/2011 10:05 PM, Colin Law wrote: On 10 November 2011 16:20, Siva Prasad wrote: On 11/10/2011 6:46 PM, Colin Law wrote: On 10 November 2011 11:46, Siva Prasadw

Re: [Rails] Adding a site admin user while creating a site

2011-11-10 Thread Colin Law
On 10 November 2011 16:20, Siva Prasad wrote: > On 11/10/2011 6:46 PM, Colin Law wrote: >> >> On 10 November 2011 11:46, Siva Prasad  wrote: >>> >>> Gurus, >>> >>> Ok, I got chance to rework on it today.As Colin suggested i debugged the >>> code with  the ruby debugger. Below is the details explai

Re: [Rails] Adding a site admin user while creating a site

2011-11-10 Thread Siva Prasad
On 11/10/2011 6:46 PM, Colin Law wrote: On 10 November 2011 11:46, Siva Prasad wrote: Gurus, Ok, I got chance to rework on it today.As Colin suggested i debugged the code with the ruby debugger. Below is the details explained. Controllers: site_controller.rb

Re: [Rails] Adding a site admin user while creating a site

2011-11-10 Thread Colin Law
On 10 November 2011 11:46, Siva Prasad wrote: > Gurus, > > Ok, I got chance to rework on it today.As Colin suggested i debugged the > code with  the ruby debugger. Below is the details explained. > > Controllers: > > site_controller.rb > > def new > > @site=sit

Re: [Rails] Adding a site admin user while creating a site

2011-11-10 Thread Siva Prasad
Gurus, Ok, I got chance to rework on it today.As Colin suggested i debugged the code with the ruby debugger. Below is the details explained. *Controllers:* site_controller.rb def new @site=site.new @site.users.build end def create @site=site.new([:par

Re: [Rails] Adding a site admin user while creating a site

2011-11-08 Thread Colin Law
On 8 November 2011 11:30, newrails user wrote: > jsut to make little more clear this resource.role='siteadmin' in the > registration_contoller. this registration_controller  is  devise  the > controller generated by devise (  I am using devise for authentication.) I don't think that changes the f

Re: [Rails] Adding a site admin user while creating a site

2011-11-08 Thread newrails user
jsut to make little more clear this resource.role='siteadmin' in the registration_contoller. this registration_controller is devise the controller generated by devise ( I am using devise for authentication.) --Siva On Tue, Nov 8, 2011 at 2:19 PM, Colin Law wrote: > On 8 November 2011 00:28,

Re: [Rails] Adding a site admin user while creating a site

2011-11-08 Thread Colin Law
On 8 November 2011 00:28, newrails user wrote: > So This is what it is happennig, the role assign works well if i create user > normally from its own view, But if I create the user form the site creation > view. the role assignment statement (resource.role="siteadmin") doesnt work. > This code exi

Re: [Rails] Adding a site admin user while creating a site

2011-11-07 Thread newrails user
So This is what it is happennig, the role assign works well if i create user normally from its own view, But if I create the user form the site creation view. the role assignment statement (resource.role="siteadmin") doesnt work. This code exisits in the user controller. Any inputs would be apprec

Re: [Rails] Adding a site admin user while creating a site

2011-11-07 Thread newrails user
HI Gurus, I could achieve this, I wanted to updated a filed in user table without taking input from user as asked before.I wanted to set a role to user without taking input from user.So in registration_controller action of (devise) I have set resource.role='siteadmin'.But its not taking that it a

Re: [Rails] Adding a site admin user while creating a site

2011-11-05 Thread Colin Law
On 5 November 2011 15:19, newrails user wrote: > Hi Gurus, > > I wanted to add siteadmin user(basically a user with a certain role)  while > creating the site itself.  I hope that i have done all the necessary stuff > by going through raynb's railscasts > (http://railscasts.com/episodes/196-nested

[Rails] Adding a site admin user while creating a site

2011-11-05 Thread newrails user
Hi Gurus, I wanted to add siteadmin user(basically a user with a certain role) while creating the site itself. I hope that i have done all the necessary stuff by going through raynb's railscasts ( http://railscasts.com/episodes/196-nested-model-form-part-1) But could not see user fields being d