0.0
No commit activity in last 3 years
No release in over 3 years
Edit settings (options)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 4.2
 Project Readme

SimpleOptions

Rails gem to edit settings (options).

Installation

Gemfile:

gem 'simple_options'

bundle it:

bundle install

Add migrations using generator:

rails g simple_options:install

Migrate the database:

rake db:migrate

It will add table 'options' to the database.

Usage

Get option value

v = Option.get('site_name', '')

Set option value:

Option.set('site_name', 'my super site')

Overview

Each site may have many options. Option is identified by name.

Option has fields:

  • name - unique name
  • value - value stored for the option
  • title - human readable name
  • description - long description
  • option_type - type of the option. = string | int | boolean
  • is_changed - whether option can be changed via admin area
  • category - name of the category