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
- At least version 6.7.2 of CMS Fiona is required.
- Follow the instructions to install CMS Fiona.
- Install the software required for the Rails Connector according to the instructions in the Installation Requirements section.
- 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.
- Afterwards, change to the project directory.
$ cd myProject - Up to Version 6.8.0: Copy your license file,
license.xml, to theconfigdirectory underneath the project directory.
Installation
- In addition to the database configuration for each environment, the
database.ymlfile needs to contain the proper definition of the CMS Fiona database:A database user with read-only access should be used for the connection to the Fiona database.cms: adapter: mysql database: MyFionaDB username: MyFionaDB-Read-User password: MyFionaDB-Read-User-Password socket: /var/run/mysqld/mysqld.sock
- Add the required Rails Connector gems to the
Gemfile:Install the additional software usinggem 'mysql2' gem 'infopark_rails_connector', '~> x.y.z' gem 'infopark_fiona_connector', '~> x.y.z'
bundler:$ bundle install - 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:
This command integrates the required CSS files included in the gem into
$ 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
app/assets/application.css. Furthermore, JavaScript files are integrated intoapp/assets/application.js. Furthermore,config/initializers/rails_connector.rbas well asconfig/local/configuration.rbare created. The Rails Connector uses the jQuery JavaScript library for creating and handling edit markers, comments, and ratings. This library is installed automatically. - By means of the
config/initializer/rails_connector.rbinitializer file you can adapt the modes of operation of the Rails Connector. In case you are using a CMS instance name other thandefault, provide the correct instance name by modifying the following line in the initializer:By means of theRailsConnector::Configuration.instance_name = 'instance_name'
configuration.rbfile, the Rails project can be adapted to your local development environment. - Start the rails application server by issuing the following command:
The server will be available for browsing at
$ rails shttp://localhost:3000.
Next Steps
- 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 - 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 toinfopark_rails_connectororinfopark_fiona_connector. More information on running a gem server is available on the RubyGems site. - If you use the Rails application for previewing CMS content, configure the preview accordingly.
- Please also configure the deployment for the different environments.