module Navigation def url_path(*path_parts) [ path_prefix, path_parts ].join("/").squeeze('/') end alias_method :u, :url_path def h(text) Rack::Utils.escape_html(text) end def path_prefix request.env['SCRIPT_NAME'] end def tabs [ {:name => 'Overview', :path => '/overview'}, {:name => 'DLQ Console', :path => '/dlq_console'} ] end def csrf_token # Set up by Rack::Protection session[:csrf] end def csrf_token_tag # If csrf_token is nil, and we submit a blank string authenticity_token # param, Rack::Protection will fail. if csrf_token "" end end def partial(template, local_vars = {}) @partial = true erb(template.to_sym, {:layout => false}, local_vars) ensure @partial = false end end