From 7be8e232c154e8dc93f85e4a249e7a4406ff313b Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Mon, 9 Jul 2007 22:27:13 +0000 Subject: [PATCH] ActionItem4: added a filter by parent and navigaton --- app/controllers/manage_tags_controller.rb | 3 ++- app/views/manage_tags/_a_tag.rhtml | 3 ++- app/views/manage_tags/list.rhtml | 3 ++- db/migrate/007_acts_as_taggable_migration.rb | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/manage_tags_controller.rb b/app/controllers/manage_tags_controller.rb index 6677801..ba574c3 100644 --- a/app/controllers/manage_tags_controller.rb +++ b/app/controllers/manage_tags_controller.rb @@ -5,7 +5,8 @@ class ManageTagsController < ApplicationController end def list - @tags = Tag.find_all + @parent = Tag.find(params[:parent]) if params[:parent] + @tags = Tag.find_all_by_parent_id(params[:parent]) end def new diff --git a/app/views/manage_tags/_a_tag.rhtml b/app/views/manage_tags/_a_tag.rhtml index c59d7e2..3d7d115 100644 --- a/app/views/manage_tags/_a_tag.rhtml +++ b/app/views/manage_tags/_a_tag.rhtml @@ -1,8 +1,9 @@
  • +<%= a_tag.id %> <%= a_tag.name %> <%= link_to _('Edit'), {:action => 'edit', :id => a_tag } %> <%= link_to _('Destroy'), {:action => 'destroy', :id => a_tag} %> -