Sha256: 4cdb75bdb7d5e431ee971a1f7d8565a60acc6ac656b5447c9a05a5ce74fb776f
Contents?: true
Size: 1.08 KB
Versions: 18
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true require "rails/generators" require_relative "generator_helper" module ReactOnRails module Generators class ReactNoReduxGenerator < Rails::Generators::Base include GeneratorHelper Rails::Generators.hide_namespace(namespace) source_root(File.expand_path("../templates", __FILE__)) def copy_base_files base_path = "base/base/" base_files = %w[client/app/bundles/HelloWorld/components/HelloWorld.jsx] base_files.each { |file| copy_file("#{base_path}#{file}", file) } end def create_appropriate_templates base_path = "base/base/" location = "client/app/bundles/HelloWorld/" source = base_path + location config = { component_name: "HelloWorld", app_relative_path: "../components/HelloWorld" } template("#{source}/startup/registration.jsx.tt", "#{location}/startup/registration.jsx", config) template("#{base_path}app/views/hello_world/index.html.erb.tt", "app/views/hello_world/index.html.erb", config) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems