myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2695] trunk/app/controllers/services_controller.


From: noreply
Subject: [myexperiment-hackers] [2695] trunk/app/controllers/services_controller.rb: added redirect from service show page to service uri
Date: Thu, 8 Sep 2011 16:03:01 -0400 (EDT)

Revision
2695
Author
dgc
Date
2011-09-08 16:03:01 -0400 (Thu, 08 Sep 2011)

Log Message

added redirect from service show page to service uri

Modified Paths

Diff

Modified: trunk/app/controllers/services_controller.rb (2694 => 2695)


--- trunk/app/controllers/services_controller.rb	2011-09-08 16:31:31 UTC (rev 2694)
+++ trunk/app/controllers/services_controller.rb	2011-09-08 20:03:01 UTC (rev 2695)
@@ -7,7 +7,7 @@
 
   include ApplicationHelper
 
-#  before_filter :find_service,  : [:show]
+  before_filter :find_service,  : [:show]
   before_filter :find_services, : [:all]
   
   # GET /algorithms;search
@@ -55,7 +55,7 @@
   
   # GET /service/1
   def show
-    raise ActionController::UnknownAction.new
+    redirect_to(@contributable.uri)
   end
   
   protected
@@ -68,22 +68,22 @@
   end
   
   def find_service
-#    begin
-#      service = Service.find(params[:id])
-#      
-#      @contributable = service
-#      
-#      @contributable_entry_url = url_for : false,
-#                          :host => base_host,
-#                          :id => @contributable.id
-#
-#      @contributable_label                = @contributable.name
-#      @contributable_path                 = service_path(@contributable)
-#
-#    rescue ActiveRecord::RecordNotFound
-#      error("Service not found", "is invalid")
-#      return false
-#    end
+    begin
+      service = Service.find(params[:id])
+      
+      @contributable = service
+      
+      @contributable_entry_url = url_for : false,
+                          :host => base_host,
+                          :id => @contributable.id
+
+      @contributable_label                = @contributable.name
+      @contributable_path                 = service_path(@contributable)
+
+    rescue ActiveRecord::RecordNotFound
+      error("Service not found", "is invalid")
+      return false
+    end
   end
   
   private

reply via email to

[Prev in Thread] Current Thread [Next in Thread]