Sha256: b18bdc84c96b0b289c1b0068036c742be3cc46072c2ea07040fd463c3d75df09

Contents?: true

Size: 487 Bytes

Versions: 7

Compression:

Stored size: 487 Bytes

Contents

class FreemarkerGenerator < BaseScaffold

  def self.source_root
    File.dirname(__FILE__)
  end

  def build
    create_view("index")
    create_view("show")
    create_view("form")
    create_view("edit")
    create_view("new", "new#{class_name}")
  end

  def create_view(template_name, file_name=template_name)
    template("templates/#{template_name}.erb", "#{Configuration::WEB_INF}/views/#{@model}/#{file_name}.ftl")
  end

  def path
    "${base}/#{@model.pluralize}"
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vraptor-scaffold-1.1.0 lib/vraptor-scaffold/generators/scaffold_generator/freemarker_generator/freemarker_generator.rb
vraptor-scaffold-1.1.0.pre lib/vraptor-scaffold/generators/scaffold_generator/freemarker_generator/freemarker_generator.rb
vraptor-scaffold-1.0.0 lib/generators/scaffold_generator/freemarker_generator/freemarker_generator.rb
vraptor-scaffold-0.0.4 lib/generators/scaffold_generator/freemarker_generator/freemarker_generator.rb
vraptor-scaffold-0.0.3 lib/generators/scaffold_generator/freemarker_generator/freemarker_generator.rb
vraptor-scaffold-0.0.2 lib/generators/scaffold_generator/freemarker_generator/freemarker_generator.rb
vraptor-scaffold-0.0.1 lib/generators/scaffold_generator/freemarker_generator/freemarker_generator.rb