From bb89e6965ffa826cef9533d0c803bc4da5e20ab8 Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Wed, 8 Aug 2007 20:26:36 +0000 Subject: [PATCH] ActionItem1: added an searchbox to search enterprises by tag --- app/controllers/enterprise_controller.rb | 5 ++++- app/views/enterprise/list.rhtml | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/controllers/enterprise_controller.rb b/app/controllers/enterprise_controller.rb index 14ebb16..7e8bc0f 100644 --- a/app/controllers/enterprise_controller.rb +++ b/app/controllers/enterprise_controller.rb @@ -67,7 +67,10 @@ class EnterpriseController < ApplicationController @enterprise.destroy redirect_to :action => 'index' end - + + def search + @tagged_enterprises = Enterprise.find_tagged_with(params[:query]) + end protected diff --git a/app/views/enterprise/list.rhtml b/app/views/enterprise/list.rhtml index 45c6a3f..47b5dd1 100644 --- a/app/views/enterprise/list.rhtml +++ b/app/views/enterprise/list.rhtml @@ -1,3 +1,10 @@ + +

<%= link_to _('Register new enterprise'), :action => 'register_form' %>

<%= _('Listing my enterprises') %>