On Thu, Dec 18, 2008 at 11:36 AM, LAN-SUN-LUK Benjamin
<Benjamin.LAN-SUN-LUK(a)supinfo.com> wrote:
Signed-off-by: Benjamin LAN-SUN-LUK <benjamin.lan-sun-luk(a)supinfo.com>
---
app/controllers/items_controller.rb | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/app/controllers/items_controller.rb
b/app/controllers/items_controller.rb
index fa68ad0..82a12a8 100644
--- a/app/controllers/items_controller.rb
+++ b/app/controllers/items_controller.rb
@@ -38,9 +38,14 @@ class ItemsController < ApplicationController
# GET /products/1/sprints/1/items/1
def show
- @title = "Backlog Item (#{(a)backlog_item.user_story.title})"
- respond_to do |format|
- format.html
+ if @tasks.empty?
+ flash[:message] = "No tasks were found for
#{(a)backlog_item.user_story.title}"
+ redirect_to product_sprint_path(@product, @sprint)
+ else
+ @title = "Backlog Item (#{(a)backlog_item.user_story.title})"
+ respond_to do |format|
+ format.html
+ end
end
end
NAK.
The controller shouldn't be affected by this: having no backlog items
isn't an error condition. Instead, change the items/_list.html.erb so
that it shows a message that says "No backlog items found..." if the
list is empty.
--
Darryl L. Pierce <mcpierce(a)gmail.com>
Visit the Infobahn Offramp: <
http://mcpierce.multiply.com>
"Bury me next to my wife. Nothing too fancy..." - Ulysses S. Grant