-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Running as a Rails Engine
These instructions are for users with moderate to advanced knowledge of Ruby on Rails.
Fat Free CRM can be run as either a standalone Rails Application (the standard way),
or as a Rails Engine.
If you install Fat Free CRM in the standard way, you may run into problems if you make customizations,
or install plugins. When your repository gets out of sync with the main codebase, you might find yourself
frustrated by merge conflicts, or forgetting the things that you changed.
The advantage of running Fat Free CRM as an Engine is that your customizations can be kept separate from the
main codebase. You can create a bare Rails application that packages your version of Fat Free CRM, as well as plugins, configuration and deployment scripts. You can update Fat Free CRM by simply changing the version number in your Gemfile.
To install and use Fat Free CRM as a Rails Engine, you just need to add the fat_free_crm gem to the Gemfile of your Rails 3.x application.
1. Clone the ffcrm_app repo:
cd ~
git clone git://github.com/fatfreecrm/ffcrm_app.git
2. Change directory to ffcrm_app:
cd ffcrm_app
3. Set up database config:
Replace {database} with one of: postgres, mysql, mysql.mac, sqlite
cp config/database.{database}.yml config/database.yml
git add config/database.yml
git commit -m "Configured database"
4. Create database, run migrations, setup admin user, etc.:
rake ffcrm:setup
1. At the command prompt, create a new Rails application:
rails new my_crm # (where my_crm is the application name)
2. Change directory to my_crm:
cd my_crm
3. Remove a few files that fat_free_crm already provides:
(cd app && rm -f controllers/application_controller.rb \
views/layouts/application.html.erb helpers/application_helper.rb \
assets/javascripts/application.js assets/stylesheets/application.css)
4. Configure database.yml, specifying database authentication if necessary
5. Add the fat_free_crm gem to your Gemfile, with the following line:
gem 'fat_free_crm', :git => 'git://github.com/fatfreecrm/fat_free_crm.git'
6. Install gems:
bundle install
7. Create database, run migrations, setup admin user, etc.:
rake ffcrm:setup
1. Start the web server:
rails server
2. Go to http://localhost:3000 and you’ll see your new site.