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