How to implement a sandbox

I would like to give my users an opportunity to switch the application
into a sandboxmode, where it is possible to play with it without the
danger to insert junk into the database.

I guess, setting RAILS_ENV = 'development' works globally for the whole
server. Is there a possibility to switch a single session to
development?

err , just add another connection to your database.yml file and create a clone db , i dont remember who to switch environment without restarting the webserver.

anyway what you may be able to do is change the db connection.

radhames brito wrote:

anyway what you may be able to do is change the db connection.

How to do this?

Does it work for a single session, while other sessions work in
production mode? Is it possible to switch the current session to sandbox
mode and back?

what i am afraid that will be a problem are plug ins and gems, you could add a filter in the action controller and stuff, but i think that the plguins and gem may not follow

what i am afraid that will be a problem are plug ins and gems, you could add a filter in the action controller and stuff, but i think that the plguins and gem may not follow

radhames brito wrote:

anyway what you may be able to do is change the db connection.

How to do this?

Does it work for a single session, while other sessions work in

production mode? Is it possible to switch the current session to sandbox

mode and back?

Posted via http://www.ruby-forum.com/.

You received this message because you are subscribed to the Google Groups “Ruby on Rails: Talk” group.

To post to this group, send email to rubyonrails-talk@googlegroups.com.

To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

read this , this guy had your prbblem
http://www.mail-archive.com/rubyonrails-talk@googlegroups.com/msg45941.html

radhames brito wrote:

read this , this guy had your prbblem
http://www.mail-archive.com/rubyonrails-talk@googlegroups.com/msg45941.html

Very interesting. Thanks a lot.

Fritz Trapper wrote:

I would like to give my users an opportunity to switch the application
into a sandboxmode, where it is possible to play with it without the
danger to insert junk into the database.

I guess, setting RAILS_ENV = 'development' works globally for the whole
server. Is there a possibility to switch a single session to
development?

I don't think you want to do that. I think you want to create a clone
of your *production* environment (call it sandbox or something) with a
separate database, then have a completely separate instance of the
application running with RAILS_ENV set to 'sandbox'.

Best,

Marnen Laibow-Koser wrote:

I don't think you want to do that. I think you want to create a clone
of your *production* environment (call it sandbox or something) with a
separate database, then have a completely separate instance of the
application running with RAILS_ENV set to 'sandbox'.

Thats probably the safe version of the feature without experiments with
unknown results...

In which source file is RAILS_ENV defined to the current einvironment?