This guide assumes that a fully functional installation of CMS Fiona exists. Please also take account of the installation requirements.
$ rails new myProject --skip-bundle
$ cd myProject
Gemfile
:
gem 'mysql2' gem 'infopark_rails_connector', '~> x.y.z' gem 'infopark_fiona_connector', '~> x.y.z'
$ bundle install
license.xml
, to the config
directory.
# The preconfigured instance name is "default". $ cd FIONA/instance/instanceName $ ./bin/CM -railsify
$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 18 Server version: 5.0.41-community MySQL Community Edition (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> grant read on fiona_cm.* to fiona_cm_ro@localhost identified by 'fiona_cm_ro';
development
, production
, preview
, test
).
$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 18 Server version: 5.0.41-community MySQL Community Edition (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create database myProject_development; Query OK, 1 row affected (0.00 sec) mysql> grant all on myProject_development.* to fiona@localhost identified by 'fiona'; Query OK, 1 row affected (0.00 sec) mysql> create database myProject_production; Query OK, 1 row affected (0.00 sec) mysql> grant all on myProject_production.* to fiona@localhost identified by 'fiona'; Query OK, 1 row affected (0.00 sec) mysql> create database myProject_preview; Query OK, 1 row affected (0.00 sec) mysql> grant all on myProject_preview.* to fiona@localhost identified by 'fiona'; Query OK, 1 row affected (0.00 sec) mysql> create database myProject_test; Query OK, 1 row affected (0.00 sec) mysql> grant all on myProject_test.* to fiona@localhost identified by 'fiona'; Query OK, 1 row affected (0.00 sec) mysql> exit Bye
cms
)development
, production
, preview
or test
)config/database.yml
file. Adjust its content according to your database setup.
cms: adapter: mysql2 database: fiona_cm username: fiona_cm_ro password: fiona_cm_ro encoding: utf8 host: YOUR_CMS_DATABASE_SERVER development: adapter: mysql2 database: myProject_development username: fiona password: fiona encoding: utf8 host: YOUR_RAILS_DATABASE_SERVER test: adapter: mysql2 database: myProject_test username: fiona password: fiona encoding: utf8 host: YOUR_RAILS_DATABASE_SERVER production: adapter: mysql2 database: myProject_production username: fiona password: fiona encoding: utf8 host: YOUR_RAILS_DATABASE_SERVER preview: adapter: mysql2 database: myProject_preview username: fiona password: fiona encoding: utf8 host: YOUR_RAILS_DATABASE_SERVER
$ cd myProject $ 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
generator
creates the additional files required or provided by the Rails Connector.
default
instance, specify the instance name the Rails Connector should use in the config/initializer/rails_connector.rb
file:
RailsConnector::Configuration.instance_name = "instanceName"
production.rb
file:
$ cp config/environments/production.rb config/environments/preview.rb
RailsConnector::Configuration.mode = "editor"
development
environment using the following command:
$ rails s => Booting WEBrick => Rails 3.2.19 application starting in development on http://0.0.0.0:3000 Call with -d to detach => Ctrl-C to shutdown server
http://localhost:3000/
.