Sha256: b5a68529127c318c98baaa282d30a4daa44d1e52bf18f43e499ea8f8a2250b58

Contents?: true

Size: 1.04 KB

Versions: 14

Compression:

Stored size: 1.04 KB

Contents

class OrganizerApplicationGenerator < Rails::Generators::NamedBase
  source_root File.expand_path('../templates', __FILE__)
  argument :description, :type => :string 
  argument :icon, :type => :string

  def generate_organizer_application
    #Controller
    template "controllers/controller_template.erb", "app/controllers/erp_app/organizer/#{file_name}/base_controller.rb"

    #make javascript
    template "public/base.js.erb", "public/javascripts/erp_app/organizer/applications/#{file_name}/base.js"

    #make css folder
    empty_directory "public/stylesheets/erp_app/organizer/applications/#{file_name}"

    #make images folder
    empty_directory "public/images/erp_app/organizer/applications/#{file_name}"
    
    #add route
    route "match '/erp_app/organizer/#{file_name}(/:action)' => \"erp_app/organizer/#{file_name}/base\""
    
    #migration
    template "migrate/migration_template.erb", "db/data_migrations/#{RussellEdge::DataMigrator.next_migration_number(1)}_create_#{file_name}_organizer_application.rb"
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
erp_app-4.0.0 lib/generators/organizer_application/organizer_application_generator.rb
erp_app-3.1.16 lib/generators/organizer_application/organizer_application_generator.rb
erp_app-3.1.15 lib/generators/organizer_application/organizer_application_generator.rb
erp_app-3.1.14 lib/generators/organizer_application/organizer_application_generator.rb
erp_app-3.1.13 lib/generators/organizer_application/organizer_application_generator.rb
erp_app-3.1.12 lib/generators/organizer_application/organizer_application_generator.rb
erp_app-3.1.11 lib/generators/organizer_application/organizer_application_generator.rb
erp_app-3.1.10 lib/generators/organizer_application/organizer_application_generator.rb
erp_app-3.1.9 lib/generators/organizer_application/organizer_application_generator.rb
erp_app-3.1.8 lib/generators/organizer_application/organizer_application_generator.rb
erp_app-3.1.7 lib/generators/organizer_application/organizer_application_generator.rb
erp_app-3.1.6 lib/generators/organizer_application/organizer_application_generator.rb
erp_app-3.1.5 lib/generators/organizer_application/organizer_application_generator.rb
erp_app-3.1.4 lib/generators/organizer_application/organizer_application_generator.rb