module AutoForme

  1. lib/autoforme.rb
  2. lib/autoforme/action.rb
  3. lib/autoforme/framework.rb
  4. lib/autoforme/frameworks/rails.rb
  5. lib/autoforme/frameworks/roda.rb
  6. lib/autoforme/frameworks/sinatra.rb
  7. lib/autoforme/model.rb
  8. lib/autoforme/models/sequel.rb
  9. lib/autoforme/opts_attributes.rb
  10. lib/autoforme/request.rb
  11. lib/autoforme/table.rb
  12. lib/autoforme/version.rb
  13. show all

Methods

Public Class

  1. for
  2. version

Constants

FRAMEWORKS = {}  

Map of framework type symbols to framework classes

MAJOR = 1  

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

MINOR = 12  

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

MODELS = {}  

Map of model type symbols to model classes

TINY = 0  

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

VERSION = "#{MAJOR}.#{MINOR}.#{TINY}".freeze  

Version constant, use AutoForme.version instead.

VERSION_NUMBER = MAJOR*10000 + MINOR*100 + TINY  

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

Public Class methods

for(type, controller, opts={}, &block)

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
[show source]
   # File lib/autoforme.rb
47 def self.for(type, controller, opts={}, &block)
48   Framework.for(type, controller, opts, &block)
49 end
version()

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

[show source]
   # File lib/autoforme/version.rb
22 def self.version
23   VERSION
24 end