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

MODELS = {}  

Map of model type symbols to model classes

VERSION = '1.6.0'.freeze  

Version constant, use AutoForme.version instead.

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, line 47
def self.for(type, controller, opts={}, &block)
  Framework.for(type, controller, opts, &block)
end
version ()

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

[show source]
# File lib/autoforme/version.rb, line 7
def self.version
  VERSION
end