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]
<strong>Pages</strong>
<ul>
<li><%= link_to "Home", root_path %></li>
<li><%= link_to "Products", products_path %></li>
</ul>
[/html]
views/admin/base/_side.html.erb
[html]
<strong>Pages</strong>
<ul>
<li><%= link_to "Home", root_path %></li>
<li><%= link_to "Products", products_path %></li>
<li><%= link_to "Manage Products", admin_products_path %></li>
<li><%= link_to "Manage Categories", admin_categories_path %></li>
</ul>
[/html]
views/mobile_subdomain/products/index.html.erb
[html]
<h1>Mobile Version</h1>
[/html]
edit.html.erb
[html]
<%= controller.view_paths %>
[/html]