Usage Scenarios for the Rails Connector

For using Infopark Rails Connector, several scenarios should be considered. They are briefly presented in the following:

  • Preview in the CMS

    • For the preview in the editorial system you require a Ruby on Rails installation and the Rails application that delivers the preview pages. This application should be taken from a versioning system.
    • For the preview to work on the user side, you require a web server that redirects the GUI and the preview URLs to the respective server. This redirection needs to be configured in the webserver. Furthermore, the GUI needs to be configured so that it generates correct preview URLs.
  • 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.

    • Install Ruby on Rails on your machine. CMS Fiona is not required because you do not need to create content.
    • Create a new Rails application or take it from the versioning system.
    • In this application, install the Rails Connector, if you have not already done so.
    • Install a database on your machine and import a dump you made from the database on the editorial system. Alternatively, direct access to the database on the editorial system can be set up.
    • Set up the database model of your application so that it can access the data in the database.
    • In the application, write or modify the controllers and the views, i.e. add functionality (business logic) and layout (presentation logic) to the application.
    • Update the repository of the version control system in regular intervals to make your code available to others working on the same project.
  • 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.

Database use

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.