From 584ae65dc6c8cca086958e87a9d3c84867cb0605 Mon Sep 17 00:00:00 2001 From: Coleman Date: Mon, 1 Sep 2008 12:30:48 -0500 Subject: [PATCH] adding drupal feed redirect --- app/controllers/node.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/node.rb b/app/controllers/node.rb index f150bf0..2bf0180 100644 --- a/app/controllers/node.rb +++ b/app/controllers/node.rb @@ -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 "You are being redirected." end -end \ No newline at end of file +end