Re: [Rails] Project

2012-02-13 Thread Siva Prasad
CanCan would be simple to achieve what you want.Install cancan gem and define Ability.rb in models Sample Abillity.rb might look like this. class Ability include CanCan::Ability def initialize(user) # Define abilities for the passed in user here. For example: # user ||= Use

Re: [Rails] mysqlerror for mongodb documents in testenvironment

2012-01-25 Thread Siva Prasad
looks like the controller is assuming that the book_history table in mysql's db. have you specified the app to talk with mongodb. other things like update and all worked for this tables? my opnion is they might not work as well. Thanks, Siva On 1/25/2012 2:16 PM, Lucky Nl wrote: Hi friends,

[Rails] Re: getting a subdomain name in model.

2011-11-28 Thread Siva Prasad
Hi All, can somebody help me on this. --Siva On 11/28/2011 6:41 AM, newrails user wrote: Hi all, I am facing problem in getting subdomain name inside the model. The following is my setup. I am using cancan for authorization.I wanted a specific condition in Ability.rb ( the file which is plac

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 Prasad

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 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