mirror of https://github.com/rails/rails
Skip CSS when creating APIs.
Update CHANGELOG. Address requested changes.
This commit is contained in:
parent
cf26c54829
commit
4ddf6ccad0
|
@ -1,3 +1,7 @@
|
|||
* Skip CSS when generating APIs.
|
||||
|
||||
*Ruy Rocha*
|
||||
|
||||
* Rails console now indicates application name and the current Rails environment:
|
||||
|
||||
```txt
|
||||
|
|
|
@ -599,6 +599,7 @@ module Rails
|
|||
end
|
||||
|
||||
def css_gemfile_entry
|
||||
return if options[:api]
|
||||
return unless options[:css]
|
||||
|
||||
if !using_js_runtime? && options[:css] == "tailwind"
|
||||
|
|
|
@ -94,6 +94,18 @@ class ApiAppGeneratorTest < Rails::Generators::TestCase
|
|||
assert_no_directory "app/views"
|
||||
end
|
||||
|
||||
def test_generator_skip_css
|
||||
run_generator [destination_root, "--api", "--css=tailwind"]
|
||||
|
||||
assert_file "Gemfile" do |content|
|
||||
assert_no_match(%r/gem "tailwindcss-rails"/, content)
|
||||
end
|
||||
|
||||
assert_no_file "app/views/layouts/application.html.erb" do |content|
|
||||
assert_no_match(/tailwind/, content)
|
||||
end
|
||||
end
|
||||
|
||||
def test_app_update_does_not_generate_unnecessary_config_files
|
||||
run_generator
|
||||
|
||||
|
|
Loading…
Reference in New Issue