Module: AutoForme
- Defined in:
- lib/autoforme.rb,
lib/autoforme/model.rb,
lib/autoforme/table.rb,
lib/autoforme/action.rb,
lib/autoforme/request.rb,
lib/autoforme/version.rb,
lib/autoforme/framework.rb,
lib/autoforme/models/sequel.rb,
lib/autoforme/opts_attributes.rb,
lib/autoforme/frameworks/rails.rb,
lib/autoforme/frameworks/sinatra.rb
Defined Under Namespace
Modules: Frameworks, Models, OptsAttributes Classes: Action, Error, Framework, Model, Request, Table
Constant Summary collapse
- FRAMEWORKS =
Map of framework type symbols to framework classes
{}
- MODELS =
Map of model type symbols to model classes
{}
- VERSION =
Version constant, use
AutoForme.version
instead. '0.5.1'.freeze
Class Method Summary collapse
-
.for(type, controller, opts = {}, &block) ⇒ Object
Create a new set of model forms.
-
.version ⇒ Object
Returns the version as a frozen string (e.g. ‘0.1.0’).
Class Method Details
.for(type, controller, opts = {}, &block) ⇒ Object
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
46 47 48 |
# File 'lib/autoforme.rb', line 46 def self.for(type, controller, opts={}, &block) Framework.for(type, controller, opts, &block) end |
.version ⇒ Object
Returns the version as a frozen string (e.g. ‘0.1.0’)
6 7 8 |
# File 'lib/autoforme/version.rb', line 6 def self.version VERSION end |