Sha256: da1983931ef36542aedea335693a40a3c3fc884fe8f4b9e6d49fd8e98d83bdb5
Contents?: true
Size: 666 Bytes
Versions: 173
Compression:
Stored size: 666 Bytes
Contents
# frozen_string_literal: true # require 'generators/rails/resource_route/resource_route_generator' class PgResourceRouteGenerator < Rails::Generators::NamedBase source_root File.expand_path('templates', __dir__) # Properly nests namespaces passed into a generator # # $ bin/rails generate resource admin/users/products # # should give you # # namespace :admin do # namespace :users do # resources :products # end # end def add_resource_route return if options[:actions].present? route_s = <<~RUBY pg_resource(:#{file_name.pluralize}) RUBY route route_s, namespace: regular_class_path end end
Version data entries
173 entries across 173 versions & 1 rubygems