Sha256: 90aa9ea30fde9ba9b9a5b480dfa61e6dd0155ae1c45dadee196a19e7a66113fc
Contents?: true
Size: 669 Bytes
Versions: 8
Compression:
Stored size: 669 Bytes
Contents
require "rails/generators/base" require "administrate/generator_helpers" module Administrate class ViewGenerator < Rails::Generators::Base include Administrate::GeneratorHelpers private def self.template_source_path File.expand_path( "../../../app/views/administrate/application", __FILE__, ) end def copy_resource_template(template_name) template_file = "#{template_name}.html.erb" copy_file( template_file, "app/views/admin/#{resource_path}/#{template_file}", ) end def resource_path args.first.try(:underscore).try(:pluralize) || "application" end end end
Version data entries
8 entries across 8 versions & 1 rubygems