· 1 min read

Screencast: Vererbung von Templates

Downloads in verschiedenen Formaten:

source code mp4 m4v webm ogv

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 %>
[/html]

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 %>
[/html]

views/mobile_subdomain/products/index.html.erb

[html]

Mobile Version

[/html]

edit.html.erb

[html] <%= controller.view_paths %> [/html]

Back to Blog