module AutoForme

Constants

FRAMEWORKS

Map of framework type symbols to framework classes

MAJOR

The major version of AutoForme, updated only for major changes that are likely to require modification to apps using AutoForme.

MINOR

The minor version of AutoForme, updated for new feature releases of AutoForme.

MODELS

Map of model type symbols to model classes

TINY

The patch version of AutoForme, updated only for bug fixes from the last feature release.

VERSION

Version constant, use AutoForme.version instead.

VERSION_NUMBER

The full version of AutoForme as a number (1.8.0 => 10800)

Public Class Methods

for(type, controller, opts={}, &block) click to toggle source

Create a new set of model forms. Arguments:

type

A type symbol for the type of framework in use (:sinatra or :rails)

controller

The controller class in which to load the forms

opts

Options hash. Current supports a :prefix option if you want to mount the forms in a different prefix.

Example:

AutoForme.for(:sinatra, Sinatra::Application, :prefix=>'/path') do
  model Artist
end
   # File lib/autoforme.rb
48 def self.for(type, controller, opts={}, &block)
49   Framework.for(type, controller, opts, &block)
50 end
version() click to toggle source

Returns the version as a frozen string (e.g. '0.1.0')

   # File lib/autoforme/version.rb
22 def self.version
23   VERSION
24 end