Sha256: de8ce0942250d281e760481ff368198fe460c9c5725edc57d3a6cea91c55d2d3
Contents?: true
Size: 653 Bytes
Versions: 8
Compression:
Stored size: 653 Bytes
Contents
# frozen_string_literal: true require "rails/generators/erb/component_generator" module Slim module Generators class ComponentGenerator < Erb::Generators::ComponentGenerator source_root File.expand_path("templates", __dir__) class_option :require_content, type: :boolean, default: false def copy_view_file template "component.html.slim", File.join("app/components", class_path, "#{file_name}_component.html.slim") end private def requires_content? options["require_content"] end def file_name @_file_name ||= super.sub(/_component\z/i, "") end end end end
Version data entries
8 entries across 8 versions & 1 rubygems