Sha256: f8fdba3c6a013d5d791263af43a718701e1a6f29fb79e9a544894f00c77aec07

Contents?: true

Size: 604 Bytes

Versions: 4

Compression:

Stored size: 604 Bytes

Contents

require File.dirname(__FILE__) + '/../../lib/view_mapper'

class ScaffoldForViewGenerator < ScaffoldGenerator

  include ViewMapper

  attr_accessor :valid

  def initialize(runtime_args, runtime_options = {})
    super
    @source_root = self.class.lookup('scaffold').path + '/templates'
    validate
  end
  
  def validate
    @valid = true
  end

  def record
    EditableManifest.new(self) { |m| yield m }
  end

  def manifest
    super.edit do |action|
      action unless !@valid
    end
  end

  def banner
    "script/generate scaffold_for_view model [ --view view:view_parameter ]"
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
view_mapper-0.3.4 generators/scaffold_for_view/scaffold_for_view_generator.rb
view_mapper-0.3.3 generators/scaffold_for_view/scaffold_for_view_generator.rb
view_mapper-0.3.2 generators/scaffold_for_view/scaffold_for_view_generator.rb
view_mapper-0.3.1 generators/scaffold_for_view/scaffold_for_view_generator.rb