Sha256: 23fe15394d4ea0b1c9e790609cd05d8f7f82c71e9e2abd0fab6f69b51bca229e

Contents?: true

Size: 623 Bytes

Versions: 1

Compression:

Stored size: 623 Bytes

Contents

module Dbla
  class RoutesGenerator < Rails::Generators::Base
    
    source_root File.expand_path('../templates', __FILE__)
    
    argument     :controller_name  , type: :string , default: "catalog"

    desc """
  This generator makes the following changes to your application:
   1. Adds routes for your controller
         """

    def inject_dbla_routes
      # These will end up in routes.rb file in reverse order
      # we add em, since each is added at the top of file. 
      # we want "root" to be FIRST for optimal url generation. 
      route("Dbla::Routes.for(self, :#{controller_name})")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dbla-0.0.2 lib/generators/dbla/routes_generator.rb