diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2017-09-24 21:43:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-24 21:43:53 +0200 |
commit | 1a7f0890c3f0472ca5521d391dd0cc611c9ca328 (patch) | |
tree | 72af0500f623def5b60f253fc573ce43c50fbdd0 /railties/lib/rails | |
parent | 38308e6d1353eda587d676ac40ce489c638fb0c3 (diff) | |
parent | 11444d7b58948648c3636b920cc839c61aa60c7e (diff) | |
download | rails-1a7f0890c3f0472ca5521d391dd0cc611c9ca328.tar.gz rails-1a7f0890c3f0472ca5521d391dd0cc611c9ca328.tar.bz2 rails-1a7f0890c3f0472ca5521d391dd0cc611c9ca328.zip |
Merge pull request #30693 from yhirano55/refactor_css_scaffold_generator
Refactor Css::Generators::ScaffoldGenerator
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/css/scaffold/scaffold_generator.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/css/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/css/scaffold/scaffold_generator.rb index 5996cb1483..d8eb4f2c7b 100644 --- a/railties/lib/rails/generators/css/scaffold/scaffold_generator.rb +++ b/railties/lib/rails/generators/css/scaffold/scaffold_generator.rb @@ -5,13 +5,13 @@ require_relative "../../named_base" module Css # :nodoc: module Generators # :nodoc: class ScaffoldGenerator < Rails::Generators::NamedBase # :nodoc: + source_root Rails::Generators::ScaffoldGenerator.source_root + # 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) + copy_file "scaffold.css", "app/assets/stylesheets/scaffold.css" end end end |