Class: Lina::ViewGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/lina/view/view_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_view_filesObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/generators/lina/view/view_generator.rb', line 7

def copy_view_files
  base_path = File.join("app/views", class_path, file_name)
  empty_directory base_path

  actions.each do |action|
    @action = action
    @path = File.join(base_path, "#{action}.json.jbuilder")
    template 'view.json.jbuilder', @path
  end
end