Class: AlphaApi::Generators::ResourceGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- AlphaApi::Generators::ResourceGenerator
- Defined in:
- lib/generators/resource/resource_generator.rb
Instance Method Summary collapse
Instance Method Details
#generate_controller_file ⇒ Object
13 14 15 16 17 |
# File 'lib/generators/resource/resource_generator.rb', line 13 def generate_controller_file prefix = AlphaApi.application.settings.api_prefix @boilerplate = Boilerplate.new(class_name, prefix) template "controller.rb.erb", "app/controllers/#{prefix}/#{file_path.tr('/', '_').pluralize}_controller.rb" end |
#generate_serializer_file ⇒ Object
19 20 21 22 23 |
# File 'lib/generators/resource/resource_generator.rb', line 19 def generate_serializer_file prefix = AlphaApi.application.settings.api_prefix @boilerplate = Boilerplate.new(class_name, prefix) template "serializer.rb.erb", "app/serializers/#{prefix}/#{file_path.tr('/', '_')}_serializer.rb" end |