module EvilScaffold
Constants
- CreateAction
- DeleteAction
- DestroyAction
- EditAction
- FinderMethod
- GENERATORS
- GotoShowMethod
- IndexAction
- IndexJson
- NewAction
- ReturnAppropriatelyMethod
- ShowAction
- UpdateAction
- VERSION
Public Class Methods
add_generator(&block)
click to toggle source
# File lib/evil_scaffold/plugin.rb, line 4 def self.add_generator &block mod = Module.new &block GENERATORS << mod mod end
Public Instance Methods
acts_as_evil(target_model, action_names, options={}) { |config| ... }
click to toggle source
# File lib/evil_scaffold.rb, line 43 def acts_as_evil target_model, action_names, options={} extend Configurable self.evil = config = Configuration.new config.klass = self config.names = Set.new action_names config.model_class_name = target_model.name config.model_name = config.model_class_name.underscore GENERATORS.each { |gen| gen.prepare config if gen.respond_to?(:prepare) } options.each { |k,v| config.send k, v } yield config if block_given? config.models_name ||= config.model_name.to_s.pluralize GENERATORS.each { |gen| gen.install config } end