class ViewGenerator

Public Instance Methods

create_root_directory() click to toggle source
# File lib/generators/view/view_generator.rb, line 9
def create_root_directory
  empty_directory(File.join('app/views', file_name)) if actions.empty?
end
create_view_file() click to toggle source
# File lib/generators/view/view_generator.rb, line 13
def create_view_file
  return if actions.empty?

  actions.each do |filename|
    path = File.join('app/views', class_path, file_name, "#{filename}.html.erb")
    template('view.html.erb', path)
  end
end
generate_locale_file() click to toggle source
# File lib/generators/view/view_generator.rb, line 22
def generate_locale_file
  invoke('locale:view', [name]) if configuration.autoload_view_generator_locale
end
generate_test_file() click to toggle source
# File lib/generators/view/view_generator.rb, line 26
def generate_test_file
  framework = configuration.test_framework

  return if framework.nil?

  invoke("#{framework}:view", [name]) rescue nil
end

Private Instance Methods

configuration() click to toggle source
# File lib/generators/view/view_generator.rb, line 36
def configuration
  ActiveGenerator.configuration
end