Adds ActiveRecord models and javascript assets for rails to swissmatch.
Install the gem: gem install swissmatch-rails
Depending on how you installed rubygems, you have to use sudo
:
sudo gem install swissmatch-rails
In Ruby: require 'swissmatch/rails'
To use swissmatch-rails, the best way is to put the following line into your Gemfile:
gem 'swissmatch', :require => 'swissmatch/rails'
If you want to load the data into your database, you can use:
swissmatch_db create
swissmatch_db seed
This needs active_record 3.2+ to be installed, and you should either be in a rails project, or
use the -c option to specify a database configuration file.
The models used for that can be loaded by require 'swissmatch/active_record'
.
See SwissMatch::ActiveRecord::Canton, SwissMatch::ActiveRecord::Community and
SwissMatch::ActiveRecord::ZipCode
The swissmatch-rails gem loads the configuration from PROJECT_ROOT/config/swissmatch.yml. The file should have the following structure:
global:
telsearch_key: "your telsearch API key"
data_directory: "A path to where you want your data files stored, relative paths are relative to PROJECT_ROOT"
cache_directory: "A path to where swissmatch should store its cache"
development:
# same keys as for global, you can have environment specific settings here
The key 'global' will be used as the base for every environment.
- {SwissMatch::ActiveRecord} Container for all ActiveRecord models
- Main Project
- Online API Documentation
- Public Repository
- Bug Reporting
- RubyGems Site
- Swiss Posts MAT[CH]
You can use this code under the {file:LICENSE.txt BSD-2-Clause License}, free of charge. If you need a different license, please ask the author.
- Swiss Life Select Schweiz AG for donating time to work on this gem.