Thank you! Yes, it is the same menu, I am simply trying to replace it.
I dont care what else is on the screen, I just want to flip the menu.
I am getting hung up on the syntax here though, I have:
link_to_remote( ‘Admin’, :update => ‘links_for_navigation’ ,nil )
the specific div where the menu(s) occur are in a div called
‘links_for_navigation’ - but the syntax here of link_to_remote, when
all I want to do is change what is in an individual dic in the
application template, I am unable to discern – the rest of the page
should merely remain the same.
Also, even if I can get the syntax right on this here, how do you set
some kind of variable (session fariable perhaps?) to know within the
ApplicationHelper which of the two menus to display? -Janna, my helper
follows…
module ApplicationHelper
def nav_link_to(name, options, html_options)
link_to name, options, html_options
end
def links_for_navigation
tabs = []
if #I need some value here to determine which menu to
choose!
tabs << link_to_remote( 'Admin', :update =>
‘links_for_navigation’ ,nil )
tabs << nav_link_to('Reports', {:controller =>
‘customers’, :action => ‘list’}, {:title => ‘Go to Reports’, :style =>
‘float: right;’})
tabs << nav_link_to(‘Customers’, {:controller =>
‘customers’, :action => ‘list’}, {:title => ‘Manage Customer’, :style
=> ‘float: right;’})
tabs << nav_link_to(‘Scheduler’, {:controller =>
‘projects’, :action => ‘list’}, {:title => ‘Go to Scheduler’, :style
=> ‘float: right;’})
tabs << nav_link_to(‘InOut’, {:controller =>
‘associates’, :action => ‘list’}, {:title => ‘In Out Board’, :style =>
‘float: right;’)
tabs << nav_link_to(‘Uplog’, {:controller =>
‘customers’, :action => ‘list’}, {:title => ‘Access Uplog’, :style =>
‘float: right;’})
else
tabs << link_to_remote( ‘Back to Application’, :update =>
‘links_for_navigation’ ,nil )
tabs << nav_link_to('Reasons', {:controller =>
‘reasons’, :action => ‘list’}, {:title => ‘Reasons’, :style => ‘float:
right;’})
tabs << nav_link_to(‘Selections’, {:controller =>
‘selections’, :action => ‘list’}, {:title => ‘Selections’, :style =>
‘float: right;’})
tabs << nav_link_to(‘Activities’, {:controller =>
‘activities’, :action => ‘list’}, {:title => ‘Activities’, :style =>
‘float: right;’})
tabs << nav_link_to(‘ActivityTypes’, {:controller =>
‘activitytypes’, :action => ‘list’}, {:title => ‘Activity
Types’, :style => ‘float: right;’})
tabs << nav_link_to(‘Status’, {:controller =>
‘status’, :action => ‘list’}, {:title => ‘Status’, :style => ‘float:
right;’})
tabs << nav_link_to(‘Origins’, {:controller =>
‘origins’, :action => ‘list’}, {:title => ‘Origins’, :style => ‘float:
right;’})
tabs << nav_link_to(‘Associates’, {:controller =>
‘associates’, :action => ‘list’}, {:title => ‘Associates’, :style =>
‘float: right;’})
end
html = ‘
’
tabs.each do |tab|
html += ‘- ’
html += tab
html += ‘ ’
end
end
end