Installing Rails Connector for CMS Fiona

Install Rails Connector in order to access and display CMS content directly from your Rails application.

The following instructions refer to Rails Connector 6.7.3 upwards. Instructions for installing previous versions can be found in the corresponding manuals (PDF). For information about updating from an earlier version of Rails Connector to the current version, please contact our Customer Service.

Prerequisites

  1. At least version 6.7.2 of CMS Fiona is required.
  2. Follow the instructions to install CMS Fiona.
  3. Install the software required for the Rails Connector according to the instructions in the Installation Requirements section.
  4. You will first need to install a MySQL database for your CMS Fiona instance, as SQLite databases are not supported by Rails Connector. To do this, please follow the instructions for integrating a different database.
  5. Afterwards, change to the project directory.
    $ cd myProject
  6. Up to Version 6.8.0: Copy your license file, license.xml, to the config directory underneath the project directory.

Installation

  1. In addition to the database configuration for each environment, the database.ymlfile needs to contain the proper definition of the CMS Fiona database:
    cms:
      adapter: mysql
      database: MyFionaDB
      username: MyFionaDB-Read-User
      password: MyFionaDB-Read-User-Password
      socket: /var/run/mysqld/mysqld.sock
    A database user with read-only access should be used for the connection to the Fiona database.
  2. Add the required Rails Connector gems to the Gemfile:
    gem 'mysql2'
    gem 'infopark_rails_connector', '~> x.y.z' 
    gem 'infopark_fiona_connector', '~> x.y.z'
    Install the additional software using bundler:
    $ bundle install
  3. In addition to program code, the gems contain generators to enable the delivery of CMS-managed content, and to make additional features available. Execute the following command within your rails application:
    $ rails generate rails_connector:install
          create  config/initializers/rails_connector.rb
          create  app/models/obj.rb
          create  config/local/configuration.rb
          append  app/assets/javascripts/application.js
            gsub  app/assets/stylesheets/application.css
          remove  public/index.html
          remove  app/assets/images/rails.png
            gsub  app/views/layouts/application.html.erb
            gsub  app/views/layouts/application.html.erb
    This command integrates the required CSS files included in the gem into app/assets/application.css. Furthermore, JavaScript files are integrated into app/assets/application.js. Furthermore, config/initializers/rails_connector.rb as well as config/local/configuration.rb are created. The Rails Connector uses the jQuery JavaScript library for creating and handling edit markers, comments, and ratings. This library is installed automatically.
  4. By means of the config/initializer/rails_connector.rb initializer file you can adapt the modes of operation of the Rails Connector. In case you are using a CMS instance name other than default, provide the correct instance name by modifying the following line in the initializer:
    RailsConnector::Configuration.instance_name = 'instance_name'
    By means of the configuration.rb file, the Rails project can be adapted to your local development environment.
  5. Start the rails application server by issuing the following command:
    $ rails s
    The server will be available for browsing at http://localhost:3000.

Next Steps

  1. To obtain detailed information about the API of the Rails Connector, please read its RDoc. To do this, start an RDoc server using this command:
    $ gem server
  2. The command will start a gem server and print out a URL for accessing the documentation of all locally installed gems. Open this URL in your browser (typically http://localhost:8808/) and navigate to infopark_rails_connector or infopark_fiona_connector. More information on running a gem server is available on the RubyGems site.
  3. If you use the Rails application for previewing CMS content, configure the preview accordingly.
  4. Please also configure the deployment for the different environments.