Sha256: fd61607d94c65b994f988b48f85943773e01f5572de4a4d52d8d5e42fafcbb4a

Contents?: true

Size: 683 Bytes

Versions: 76

Compression:

Stored size: 683 Bytes

Contents

class BrancoGenerator < Rails::Generators::NamedBase
  source_root File.expand_path('../templates', __FILE__)

  attr_reader :teste
  argument :acao, type: :string, default: [], banner: "action action"
  
  def copy_initializer_file
      @model = Module.const_get(file_name.camelize)
      @action = acao
      template 'template.rb', "app/views/#{@model.name.pluralize.underscore.to_sym}/_template.html.erb", @model,@action
      template 'action.rb', "app/views/#{@model.name.pluralize.underscore.to_sym}/#{@action}.html.erb", @model,@action
      template 'action_partial.rb', "app/views/#{@model.name.pluralize.underscore.to_sym}/_#{@action}.html.erb", @model,@action
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
templus_models-3.0.21 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-3.0.20 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-3.0.19 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-3.0.17 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-2.0.16 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-1.6.9 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-2.0.15 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-3.0.14 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-2.0.14 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-2.0.12 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-3.0.13 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-3.0.12 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-2.0.11 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-2.0.9 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-2.0.8 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-3.0.10 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-1.6.8 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-1.6.7 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-3.0.9 test/dummy/lib/generators/branco/branco_generator.rb
templus_models-2.0.7 test/dummy/lib/generators/branco/branco_generator.rb