Class: Iron::Generators::TemplateGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Iron::Generators::TemplateGenerator
- Defined in:
- lib/generators/iron/template/template_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_template_file ⇒ Object
10 11 12 13 |
# File 'lib/generators/iron/template/template_generator.rb', line 10 def create_template_file @content_type = Iron::ContentType.find_by!(handle: content_type_handle) template "content_type.html.erb", "app/views/templates/#{content_type_handle}.html.erb" end |
#display_instructions ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/generators/iron/template/template_generator.rb', line 15 def display_instructions say "\n=== Template created for '#{content_type_name}' ===\n", :green say "You can now customize the template at:" say " app/views/templates/#{content_type_handle}.html.erb" say "\nAvailable variables in the template:" say " @entry - The current entry with all its fields" say " @content_type - The content type definition" end |