Class: Caterpillar::Navigation
- Inherits:
-
Object
- Object
- Caterpillar::Navigation
- Defined in:
- lib/caterpillar/navigation.rb
Overview
Portlet navigation on Rails.
Caterpillar installs a partial ‘caterpillar/navigation’ into your views, along with an image and a CSS file. You need to add a filter ‘caterpillar’ which you will only load in development environment - in production the portlet container will be the ‘window manager’. This partial helps you to navigate between your portlets.
This will go to your ApplicationController:
if RAILS_ENV=='development'
before_filter :caterpillar
end
def caterpillar # :nodoc:
= Caterpillar::.rails
= {
:uid => 13904,
:gid => 13912
}
end
This will go the body of your layout:
<% if -%>
<%= render :partial => "caterpillar/navigation" %>
<% end -%>
Class Method Summary collapse
-
.rails ⇒ Object
Method for formulating the portlets hash in Rails environment.
Class Method Details
.rails ⇒ Object
Method for formulating the portlets hash in Rails environment
38 39 40 41 42 |
# File 'lib/caterpillar/navigation.rb', line 38 def self.rails config = Util.eval_configuration config.routes = Util.parse_routes(config) return Util.categorize(Parser.new(config).portlets) end |