提交 c44cacb0 编写于 作者: J Jeremy Kemper

Include app name in layout title

上级 ea6a67cb
......@@ -78,7 +78,12 @@ def create_root_files
end
def create_app_files
directory "app"
directory "app/controllers"
directory "app/helpers"
directory "app/models"
inside "app/views/layouts" do
template "application.html.erb"
end
end
def create_config_files
......
<!DOCTYPE html>
<html>
<head>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
<title><%= app_const_base %></title>
<%%= stylesheet_link_tag :all %>
<%%= javascript_include_tag :defaults %>
<%%= csrf_meta_tag %>
</head>
<body>
<%= yield %>
<%%= yield %>
</body>
</html>
......@@ -54,8 +54,8 @@ def test_application_skeleton_is_created
def test_application_controller_and_layout_files
run_generator
assert_file "app/controllers/application_controller.rb", /layout 'application'/
assert_file "app/views/layouts/application.html.erb", /stylesheet_link_tag 'application'/
assert_file "public/stylesheets/application.css"
assert_file "app/views/layouts/application.html.erb", /stylesheet_link_tag :all/
assert_no_file "public/stylesheets/application.css"
end
def test_name_collision_raises_an_error
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册