Displaying 2 results from an estimated 2 matches for "side_nav".
2005 Dec 02
0
RE: How to test for controller
There is a reason the controller is called *controller*. The controller
should be making this type of decision.
I would do it this way:
Class FooController < ApplicationController
def bar
@side_nav = :display_admin
End
def baz
@side_nav = :hide_admin
EndEnd
In the view:
<% if @side_nav == :display_admin %>
...
<% end %>
In your application controller, you can set a default value for the
@side_nav variable to avoid needing to set it in every action
-----Original Mess...
2006 Mar 14
5
Best way to use partial rendering in global layout
I have a global layout in application.rhtml and I''d like to render a
partial template within it.
Currently, I have this:
<%= render (:partial => ''side_nav'') %>
but it seems to be looking in the controller specific view directory.
What is the best way to do handle controller - global partial rendering?
Wes
--
Posted via http://www.ruby-forum.com/.