Sha256: 4c6b69b532408c82838760aebf3866522c5a07df4f6177b140ad44e2d104ba5f

Contents?: true

Size: 691 Bytes

Versions: 9

Compression:

Stored size: 691 Bytes

Contents

require 'generators/formtastic_erb'
require 'generators/erb/scaffold/scaffold_generator'

module FormtasticErb
  module Generators
    class ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
      extend TemplatePath

      def copy_layout_file
        return unless options[:layout]
        template "layout.html.erb",
                 File.join("app/views/layouts", controller_class_path, "#{controller_file_name}.html.erb")
      end

      protected

      def copy_view(view)
        if view =~ /^_.*/
          template "#{view}.html.erb", File.join("app/views", controller_file_path, "#{view}.html.erb")
        else
          super view
        end
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
jumpstart-0.1.0 jumpstart_templates/i0n_rails_3/lib/generators/formtastic_erb/scaffold/scaffold_generator.rb
rails3-generators-0.7.1 lib/generators/formtastic_erb/scaffold/scaffold_generator.rb
rails3-generators-0.7.0 lib/generators/formtastic_erb/scaffold/scaffold_generator.rb
rails3-generators-0.6.0 lib/generators/formtastic_erb/scaffold/scaffold_generator.rb
rails3-generators-0.5.4 lib/generators/formtastic_erb/scaffold/scaffold_generator.rb
rails3-generators-0.5.3 lib/generators/formtastic_erb/scaffold/scaffold_generator.rb
rails3-generators-0.5.2 lib/generators/formtastic_erb/scaffold/scaffold_generator.rb
rails3-generators-0.5.1 lib/generators/formtastic_erb/scaffold/scaffold_generator.rb
rails3-generators-0.5.0 lib/generators/formtastic_erb/scaffold/scaffold_generator.rb