diff --git a/actionview/lib/action_view/base.rb b/actionview/lib/action_view/base.rb index 211d4f1bef973..cb1e485fedb37 100644 --- a/actionview/lib/action_view/base.rb +++ b/actionview/lib/action_view/base.rb @@ -44,9 +44,9 @@ module ActionView # :nodoc: # Using sub templates allows you to sidestep tedious replication and extract common display structures in shared templates. The # classic example is the use of a header and footer (even though the Action Pack-way would be to use Layouts): # - # <%= render "shared/header" %> + # <%= render "application/header" %> # Something really specific and terrific - # <%= render "shared/footer" %> + # <%= render "application/footer" %> # # As you see, we use the output embeddings for the render methods. The render call itself will just return a string holding the # result of the rendering. The output embedding writes it to the current template. @@ -55,7 +55,7 @@ module ActionView # :nodoc: # variables defined using the regular embedding tags. Like this: # # <% @page_title = "A Wonderful Hello" %> - # <%= render "shared/header" %> + # <%= render "application/header" %> # # Now the header can pick up on the @page_title variable and use it for outputting a title tag: # @@ -65,9 +65,9 @@ module ActionView # :nodoc: # # You can pass local variables to sub templates by using a hash with the variable names as keys and the objects as values: # - # <%= render "shared/header", { headline: "Welcome", person: person } %> + # <%= render "application/header", { headline: "Welcome", person: person } %> # - # These can now be accessed in shared/header with: + # These can now be accessed in application/header with: # # Headline: <%= headline %> # First name: <%= person.first_name %> diff --git a/actionview/lib/action_view/layouts.rb b/actionview/lib/action_view/layouts.rb index 74bc5cfb605d8..eee8c87c911fb 100644 --- a/actionview/lib/action_view/layouts.rb +++ b/actionview/lib/action_view/layouts.rb @@ -9,9 +9,9 @@ module ActionView # Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in # repeated setups. The inclusion pattern has pages that look like this: # - # <%= render "shared/header" %> + # <%= render "application/header" %> # Hello World - # <%= render "shared/footer" %> + # <%= render "application/footer" %> # # This approach is a decent way of keeping common structures isolated from the changing content, but it's verbose # and if you ever want to change the structure of these two includes, you'll have to change all the templates. diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb index 21e16a64efec7..cb85f7ce930dc 100644 --- a/actionview/lib/action_view/template.rb +++ b/actionview/lib/action_view/template.rb @@ -96,7 +96,7 @@ class Template # # Given this sub template rendering: # - # <%= render "shared/header", { headline: "Welcome", person: person } %> + # <%= render "application/header", { headline: "Welcome", person: person } %> # # You can use +local_assigns+ in the sub templates to access the local variables: # diff --git a/actionview/test/template/dependency_tracker_test.rb b/actionview/test/template/dependency_tracker_test.rb index 2c60015604ec9..0c88b734d2aa1 100644 --- a/actionview/test/template/dependency_tracker_test.rb +++ b/actionview/test/template/dependency_tracker_test.rb @@ -125,14 +125,14 @@ def test_finds_dependency_on_multiline_render_calls def test_finds_multiple_unrelated_odd_dependencies template = FakeTemplate.new(" - <%= render('shared/header', title: 'Title') %> + <%= render('application/header', title: 'Title') %>
Here are a few of our fine products:
-... +<%# ... %> -<%= render "shared/footer" %> +<%= render "application/footer" %> ``` Here, the `_ad_banner.html.erb` and `_footer.html.erb` partials could contain @@ -1133,7 +1134,7 @@ definitions for several similar resources: * `users/index.html.erb` ```html+erb - <%= render "shared/search_filters", search: @q do |form| %> + <%= render "application/search_filters", search: @q do |form| %>Name contains: <%= form.text_field :name_contains %>
@@ -1143,14 +1144,14 @@ definitions for several similar resources: * `roles/index.html.erb` ```html+erb - <%= render "shared/search_filters", search: @q do |form| %> + <%= render "application/search_filters", search: @q do |form| %>Title contains: <%= form.text_field :title_contains %>
<% end %> ``` -* `shared/_search_filters.html.erb` +* `application/_search_filters.html.erb` ```html+erb <%= form_with model: search do |form| %> diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 92d4e6b7c6e74..dc75ecf499783 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -1371,11 +1371,11 @@ class Engine < ::Rails::Engine controller "main", <<-RUBY class MainController < ActionController::Base def foo - render inline: '<%= render partial: "shared/foo" %>' + render inline: '<%= render partial: "application/foo" %>' end def bar - render inline: '<%= render partial: "shared/bar" %>' + render inline: '<%= render partial: "application/bar" %>' end end RUBY @@ -1387,19 +1387,19 @@ def bar end RUBY - @plugin.write "app/views/shared/_foo.html.erb", <<-RUBY + @plugin.write "app/views/application/_foo.html.erb", <<-RUBY Bukkit's foo partial RUBY - app_file "app/views/shared/_foo.html.erb", <<-RUBY + app_file "app/views/application/_foo.html.erb", <<-RUBY App's foo partial RUBY - @blog.write "app/views/shared/_bar.html.erb", <<-RUBY + @blog.write "app/views/application/_bar.html.erb", <<-RUBY Blog's bar partial RUBY - app_file "app/views/shared/_bar.html.erb", <<-RUBY + app_file "app/views/application/_bar.html.erb", <<-RUBY App's bar partial RUBY @@ -1471,7 +1471,7 @@ class Engine < ::Rails::Engine controller "main", <<-RUBY class MainController < ActionController::Base def foo - render inline: '<%= render partial: "shared/foo" %>' + render inline: '<%= render partial: "application/foo" %>' end end RUBY @@ -1482,11 +1482,11 @@ def foo end RUBY - @plugin.write "app/views/shared/_foo.html.erb", <<-RUBY + @plugin.write "app/views/application/_foo.html.erb", <<-RUBY Bukkit's foo partial RUBY - app_file "app/views/shared/_foo.html.erb", <<-RUBY + app_file "app/views/application/_foo.html.erb", <<-RUBY App's foo partial RUBY