Updating a Rails 3.2 Application to Rails Connector 6.8.0

If you are running a Rails application with a Rails Connector prior to version 6.8.0, please proceed as follows to upgrade your application to Rails Connector 6.8.0. The Rails application as such must have been upgraded to Rails 3.2 before the Rails Connector is upgraded to version 6.8.0.

As with previous versions, the Rails Connector includes a generator for installing the required files to a Rails application. This generator has been optimized for installing the Rails Connector to an empty Rails application. However, it can also be used for updating an existing application. The generator overwrites existing files only after the user has confirmed a corresponding query.

Please follow the steps below to upgrade the Rails Connector to version 6.8.0:

  1. From version 6.8.0, the Rails Connector consists of two gems. In addition to the infopark_rails_connector gem, the infopark_fiona_connector gem is required. First, install both gems using gem install.

  2. Now, install the Rails Connector into your application:

    rails generate rails_connector:install

    The generator asks for confirmation before it overwrites existing files. Check the changes the generator intends to make by answering the confirmation question with ‘d’.

    The following files potentially contain application-specific changes that should not be overwritten without having looked at their contents first:

    • config/initializers/rails_connector.rb
    • lib/obj_extensions.rb
    • app/views/layouts/application.html.erb
  3. Make your application use the Asset Pipeline of Rails 3.2

    The Asset Pipeline was introduced in Rails 3.1 as a framework for efficiently delivering CSS, JavaScript, and image files (assets). The Rails Connector already delivers its CSS and JavaScript files by means of this framework.

    With Rails Connector for CMS Fiona 6.8.0 and later, the generator no longer copies assets into the application. Instead, the gem delivers the assets directly. As a consequence, existing applications will ignore all the assets generated up to now. Therefore, the following assets can be deleted:

    • public/javascripts/rails_connector/*
    • public/stylesheets/rails_connector/*
    • public/images/rails_connector/*
    • public/javascripts/rails.js
    • public/javascripts/jrails.js
    • public/javascripts/jquery.js

    To have other assets delivered by the pipeline as well, the subdirectories javascripts, stylesheets, and images should be moved from the public directory to app/assets. Afterwards, the paths concerned need to be adjusted in the application as well as in CSS and JavaScript files.

    Please note that assets are delivered using a unique URL path (/assets, by default). The URL neither contains stylesheets nor javascripts or images.

    Since the Rails preview of the GUI includes a path prefix, it is strongly recommended to not use absolute paths such as /assets/icon.png in CSS or JavaScript files. A path prefix such as /default will prevent such assets from being found. Please use relative paths instead.

  4. Freeze the version of the jQuery gem

    The jQuery JavaScript library is made available by the jquery-rails gem and the asset pipeline. Therefore, the jQuery version used is now bound to this gem. As a consequence, the version of the gem must be frozen in the Gemfile. This enables you to decide on your own whether jQuery should be updated or not. In the Gemfile of the Playland demo content, the version tested by us has been frozen.

  5. Remove the following files if they exist:

    • lib/tasks/rails_connector_addons.rake
    • lib/tasks/rspec.rake

Localization files

From version 6.7.3, Ruby on Rails localization files are no longer included in the Rails Connector packages. For running a Rails Connector application in a different language than English, localization files are required.

Session user attributes

From version 6.7.3, the attributes of a logged-in user to be temporarily stored in the session are no longer specified in the UserController. Instead, they need to be defined as follows in the config/initializers/rails_connector.rb file:

RailsConnector::Configuration.store_user_attrs_in_session = [:login, :first_name, :last_name, :email, :id]

The ID of the contact person concerned (contact_id) is always stored in the session, regardless of whether or not it is included in the list above.