For using our Rails Connector, several scenarios should be considered. They are briefly presented in the following:
Preview in the CMS
Development and layout
The layout of the web pages is based on the views of the Rails application. Normally, the following steps need to be made to set up the environment for developing a Rails application.
Testing the web application
Normally, professional Ruby on Rails web applications are accompanied by test programs to ensure that the controllers and views behave as expected. The test programs require their own database into which the test data are written. Setting up the tests is part of the development process. Normally, the tests are run on the development systems.
Live (production) system
On the live system you require the ruby on rails runtime environment, the web application including the Rails Connector for Fiona, and the database containing the CMS content. The CMS itself is not required on the live system. On the live system, the content can be updated by means of replication mechanisms, if keeping the live side up-to-date matters. However, it is also possible to transfer the content in the form of a database dump from the editorial system to the live server and restore it there. For updating the web application itself, deployment tools such as Capistrano are available. You might also want to set up another database for storing user-generated content.
By default, every Rails application has three so-called environments that support the use of the application in different settings.
An environment is a named configuration set. One of the names available
can be passed to the Rails server application. The configuration set
specifies the database to use and provides global configuration parameters
for controlling particular aspects of the application's behaviour. The
environments available as a default are development
,
test
, and production
(live system).
When using the Rails application for previewing CMS content, usually another environment is added to the application, the preview
environment. Next to the database to use, the preview
environment specifies that the draft versions of the CMS files should be delivered instead of the released versions.
Rails applications can be operated with several databases – for the Rails Connector this is the rule rather than the exception because both the editorial content and the visitor-generated data (comments, customer data and the like) are used on the live server. Since the editorial content is never modified on the live side, as opposed to the data originating from the visitors, two databases are used. This is done for clarity as well as for stability and data security reasons.
All databases can be set up in the config/database.yml
file of the Rails application. Typically, a Rails application uses the database connection named after the environment. The Rails Connector uses the connection named cms
. You do not need to modify existing connections, just add the new section named cms
.