Show More
Commit Description:
some wording...
Commit Description:
some wording git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@48 6386c4cd-e34a-4fa8-8920-d93eb39b512e
File last commit:
Show/Diff file:
Action:
app/helpers/application_helper.rb | 24 lines | 826 B | text/x-ruby | RubyLexer |
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
def user_header
options = ''
user = User.find(session[:user_id])
if user.admin?
options = options + ' ' +
(link_to_unless_current '[Problem admin]',
:controller => 'problems', :action => 'index')
options = options + ' ' +
(link_to_unless_current '[User admin]',
:controller => 'user_admin', :action => 'index')
end
options += link_to_unless_current '[Main]',
:controller => 'main', :action => 'list'
options += link_to_unless_current '[Settings]',
:controller => 'users', :action => 'index'
options = options + ' ' +
link_to('[Log out]', {:controller => 'main', :action => 'login'})
options
end
end