Commit bb89e6965ffa826cef9533d0c803bc4da5e20ab8
1 parent
afd50585
Exists in
master
and in
22 other branches
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
Showing
2 changed files
with
11 additions
and
1 deletions
Show diff stats
app/controllers/enterprise_controller.rb
| @@ -67,7 +67,10 @@ class EnterpriseController < ApplicationController | @@ -67,7 +67,10 @@ class EnterpriseController < ApplicationController | ||
| 67 | @enterprise.destroy | 67 | @enterprise.destroy |
| 68 | redirect_to :action => 'index' | 68 | redirect_to :action => 'index' |
| 69 | end | 69 | end |
| 70 | - | 70 | + |
| 71 | + def search | ||
| 72 | + @tagged_enterprises = Enterprise.find_tagged_with(params[:query]) | ||
| 73 | + end | ||
| 71 | 74 | ||
| 72 | protected | 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 | <p> <%= link_to _('Register new enterprise'), :action => 'register_form' %> </p> | 8 | <p> <%= link_to _('Register new enterprise'), :action => 'register_form' %> </p> |
| 2 | <h2> <%= _('Listing my enterprises') %> </h2> | 9 | <h2> <%= _('Listing my enterprises') %> </h2> |
| 3 | <ul> | 10 | <ul> |