Class: CmAdmin::ViewGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
ViewActionTemplate
Defined in:
lib/generators/cm_admin/view_generator.rb

Instance Method Summary collapse

Methods included from ViewActionTemplate

#copy_devise_files, #copy_form_files, #copy_index_files, #copy_show_files

Instance Method Details

#create_new_file ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/generators/cm_admin/view_generator.rb', line 63

def create_new_file
  if page_type == 'index'
    copy_index_files
  elsif page_type == 'form'
    copy_form_files
  elsif page_type == 'show'
    copy_show_files
  elsif page_type == 'devise'
    copy_devise_files
  else
    puts "Wrong page_type provided. It can be either index or show"
  end
end