Class: RedPotion::Generators::Scaffold
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- RedPotion::Generators::Scaffold
show all
- Includes:
- ModelGeneratorMethods, Thor::Actions
- Defined in:
- lib/redpotion/generators/scaffold.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#check_for_previous_schema!, #new_schema_number, #previous_schema_content, #previous_schema_filename, #previous_schema_number
Class Method Details
.source_root ⇒ Object
12
13
14
|
# File 'lib/redpotion/generators/scaffold.rb', line 12
def self.source_root
File.dirname(__FILE__)
end
|
Instance Method Details
35
36
37
|
# File 'lib/redpotion/generators/scaffold.rb', line 35
def enable_xlform_gem
end
|
#generate_model ⇒ Object
16
17
18
19
20
|
# File 'lib/redpotion/generators/scaffold.rb', line 16
def generate_model
template "templates/cdq_model.tt", "app/models/#{model_name}.rb"
check_for_previous_schema!
template "templates/cdq_migration.tt", "schemas/#{new_schema_number}_create_#{model_name}.rb"
end
|
#generate_screens ⇒ Object
22
23
24
25
26
27
|
# File 'lib/redpotion/generators/scaffold.rb', line 22
def generate_screens
template "templates/cdq_table_screen.tt", "app/screens/#{model_name.pluralize}_screen.rb"
template "templates/new_cdq_model_form_screen.tt", "app/screens/new_#{model_name}_screen.rb"
template "templates/cdq_model_detail_screen.tt", "app/screens/#{model_name}_detail_screen.rb"
template "templates/edit_cdq_model_form_screen.tt", "app/screens/edit_#{model_name}_screen.rb"
end
|
#generate_stylesheets ⇒ Object
29
30
31
32
33
|
# File 'lib/redpotion/generators/scaffold.rb', line 29
def generate_stylesheets
template "templates/table_screen_stylesheet.tt", "app/stylesheets/#{model_name.pluralize}_screen_stylesheet.rb"
template "templates/form_screen_stylesheet.tt", "app/stylesheets/#{model_name}_form_screen_stylesheet.rb"
template "templates/detail_screen_stylesheet.tt", "app/stylesheets/#{model_name}_detail_screen_stylesheet.rb"
end
|