Sha256: 53842cc1cbd1603c74a4ce444d8d8a34b477fa20d09b30ba0a9c3a2bdefcffb2
Contents?: true
Size: 872 Bytes
Versions: 6
Compression:
Stored size: 872 Bytes
Contents
require 'generators/initjs/resource_helpers' module Initjs module Generators class InstallGenerator < ::Rails::Generators::Base include Initjs::Generators::ResourceHelpers source_root File.expand_path('../templates', __FILE__) def inject_backbone inject_into_file "app/assets/javascripts/application.js", before: "//= require_tree" do "//= require #{application_name.underscore}/#{application_name.underscore}.js\n//= require init.js\n" end end def create_app_file template "app.coffee", "#{application_path}/#{application_name.underscore}.js.coffee" # Alerts puts "\n\nInclude the Initjs tag in your application layout (usually found at app/view/layouts/application.html.erb) after the body tag." puts "<%= initjs_tag '#{application_name}' %>" end end end end
Version data entries
6 entries across 6 versions & 1 rubygems