File: scaffold_generator.rb

package info (click to toggle)
ruby-railties-3.2 3.2.6-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,808 kB
  • sloc: ruby: 6,217; makefile: 10
file content (16 lines) | stat: -rw-r--r-- 609 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require "rails/generators/named_base"

module Css
  module Generators
    class ScaffoldGenerator < Rails::Generators::NamedBase
      # In order to allow the Sass generators to pick up the default Rails CSS and
      # transform it, we leave it in a standard location for the CSS stylesheet
      # generators to handle. For the simple, default case, just copy it over.
      def copy_stylesheet
        dir = Rails::Generators::ScaffoldGenerator.source_root
        file = File.join(dir, "scaffold.css")
        create_file "app/assets/stylesheets/scaffold.css", File.read(file)
      end
    end
  end
end