· 1 min read
Screencast: Vererbung von Templates
Downloads in verschiedenen Formaten:
Resourcen:
application_controller.rb
[ruby] before_filter :subdomain_view_path
private
def subdomain_view_path prepend_view_path “app/views/#{request.subdomain}_subdomain” if request.subdomain.present? end [/ruby]
views/layouts/application.html.erb
[html] <%= render “side” %> [/html]
views/application/_side.html.erb
[html] Pages
- <%= link_to “Home”, root_path %>
- <%= link_to “Products”, products_path %>
views/admin/base/_side.html.erb
[html] Pages
- <%= link_to “Home”, root_path %>
- <%= link_to “Products”, products_path %>
- <%= link_to “Manage Products”, admin_products_path %>
- <%= link_to “Manage Categories”, admin_categories_path %>
views/mobile_subdomain/products/index.html.erb
[html]
Mobile Version
[/html]edit.html.erb
[html] <%= controller.view_paths %> [/html]