Class: Reativo::JsGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Reativo::JsGenerator
- Defined in:
- lib/generators/reativo/js_generator.rb
Instance Method Summary collapse
Instance Method Details
#generate_operations ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/generators/reativo/js_generator.rb', line 31 def generate_operations needs_form = false actions = ['actions'].empty? ? ['index', 'new', 'show', 'edit'] : ['actions'] actions.each do |action| template "component/#{action.capitalize}.js", component_path(action) if needs_form?(action) needs_form = true end end if needs_form template "component/Form.js", component_path("Form") end end |