Sha256: 1d0f333d97087f466bc1f3fe3aefa657453f70b8c7ad32db7f926ee2dac9927f
Contents?: true
Size: 599 Bytes
Versions: 8
Compression:
Stored size: 599 Bytes
Contents
# frozen_string_literal: true require "rails/generators/erb" module Erb module Generators class ComponentGenerator < Base source_root File.expand_path("templates", __dir__) class_option :require_content, type: :boolean, default: false def copy_view_file template "component.html.erb", File.join("app/components", class_path, "#{file_name}_component.html.erb") 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