Class: BungleGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/bungle/generators/legacy_generator.rb,
lib/generators/bungle/generators/current_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



4
5
6
# File 'lib/generators/bungle/generators/current_generator.rb', line 4

def self.source_root
  @_views_source_root ||= File.expand_path("../../templates/app/views", __FILE__)
end

Instance Method Details

#copy_viewsObject



8
9
10
11
12
# File 'lib/generators/bungle/generators/current_generator.rb', line 8

def copy_views
  generate_formtastic
  directory "inherited_resources", "app/views/inherited_resources"
  tell_them_about_them_gems
end

#manifestObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/generators/bungle/generators/legacy_generator.rb', line 2

def manifest
  directory = "app/views/inherited_resources"
  record do |m|
    m.directory directory
    m.file "#{directory}/_form.html.haml", "#{directory}/_form.html.haml"
    m.file "#{directory}/edit.html.haml", "#{directory}/edit.html.haml"
    m.file "#{directory}/index.html.haml", "#{directory}/index.html.haml"
    m.file "#{directory}/new.html.haml", "#{directory}/new.html.haml"
    m.file "#{directory}/show.html.haml", "#{directory}/show.html.haml"
  end
end