Class: Padrino::FormErrors::Generators::Defaults
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Padrino::FormErrors::Generators::Defaults
- Includes:
- Generators::Actions, Thor::Actions
- Defined in:
- lib/padrino-form-errors/generators/defaults.rb
Class Method Summary collapse
- .banner ⇒ Object
-
.source_root ⇒ Object
Define the source template root.
Instance Method Summary collapse
-
#create_views ⇒ Object
Create default views.
Class Method Details
.banner ⇒ Object
10 |
# File 'lib/padrino-form-errors/generators/defaults.rb', line 10 def self.; "padrino-gen form_errors"; end |
.source_root ⇒ Object
Define the source template root
9 |
# File 'lib/padrino-form-errors/generators/defaults.rb', line 9 def self.source_root; File.(File.dirname(__FILE__)); end |
Instance Method Details
#create_views ⇒ Object
Create default views.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/padrino-form-errors/generators/defaults.rb', line 19 def create_views ext = fetch_component_choice(:renderer) self.destination_root = [:root] if in_app_root? template "templates/#{ext}/_error_messages.#{ext}.tt", destination_root("/app/views/shared/_error_messages.html.#{ext}") template "templates/#{ext}/_error_message.#{ext}.tt", destination_root("/app/views/shared/_error_message.html.#{ext}") else say "You are not at the root of a Padrino application! (config/boot.rb not found)" end end |