Commit bb89e6965ffa826cef9533d0c803bc4da5e20ab8

Authored by MoisesMachado
1 parent afd50585

ActionItem1: added an searchbox to search enterprises by tag


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@327 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/enterprise_controller.rb
... ... @@ -67,7 +67,10 @@ class EnterpriseController < ApplicationController
67 67 @enterprise.destroy
68 68 redirect_to :action => 'index'
69 69 end
70   -
  70 +
  71 + def search
  72 + @tagged_enterprises = Enterprise.find_tagged_with(params[:query])
  73 + end
71 74  
72 75 protected
73 76  
... ...
app/views/enterprise/list.rhtml
  1 +<div class="search_box">
  2 +<% form_tag :action => 'search' do %>
  3 + <%= text_field_tag 'query' %>
  4 + <%= submit_tag _('Search') %>
  5 +<% end %>
  6 +</div>
  7 +
1 8 <p> <%= link_to _('Register new enterprise'), :action => 'register_form' %> </p>
2 9 <h2> <%= _('Listing my enterprises') %> </h2>
3 10 <ul>
... ...