adding drupal feed redirect

master
Coleman 2008-09-01 12:30:48 -05:00
parent 814e089551
commit 584ae65dc6
1 changed files with 4 additions and 3 deletions

View File

@ -5,8 +5,9 @@ class Node < Application
def show
page = Page.find_by_nid(params[:id])
raise NotFound unless page
purl = url(:page, :id => page.name.gsub(/ /, '_'))
raise NotFound unless page or params[:id] == 'feed'
purl = url(:page, :id => page.name.gsub(/ /, '_')) rescue ''
purl = url(:controller => :feeds, :action => :rss, :format => :xml) if params[:id] == 'feed'
Merb.logger.info("Permenant Redirect Drupal Node to #{purl}")
self.status = 301
headers['Location'] = purl
@ -24,4 +25,4 @@ class Node < Application
headers['Location'] = gurl
return "<html><body>You are being <a href=\"#{gurl}\">redirected</a>.</body></html>"
end
end
end