Sha256: 82bda9e9b6313395c0e826116c2271ba600c49cb5416cfa817601571c3693e25
Contents?: true
Size: 654 Bytes
Versions: 3
Compression:
Stored size: 654 Bytes
Contents
require "godmin/generators/named_base" class Godmin::ResourceGenerator < Godmin::Generators::NamedBase argument :attributes, type: :array, default: [], banner: "attribute attribute" def add_route inject_into_file "config/routes.rb", after: "godmin do\n" do <<-END.strip_heredoc.indent(4) resources :#{file_name.pluralize} END end end def create_controller template "resource_controller.rb", File.join("app/controllers", class_path, "#{file_name.pluralize}_controller.rb") end def create_service template "resource_service.rb", File.join("app/services", class_path, "#{file_name}_service.rb") end end
Version data entries
3 entries across 3 versions & 1 rubygems