Skip to content

Commit

Permalink
added search for a host package
Browse files Browse the repository at this point in the history
  • Loading branch information
ohadlevy committed May 19, 2010
1 parent 54d1ee3 commit 16c11ee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/controllers/hosts_controller.rb
Expand Up @@ -7,7 +7,8 @@ def index

def show
@host = Host.find(params[:id])
@packages = @host.packages.all.paginate :page => params[:page]
@search = @host.packages.search params[:search]
@packages = @search.all.paginate :page => params[:page]
end

def new
Expand Down
3 changes: 1 addition & 2 deletions app/views/common/_search.html.erb
@@ -1,7 +1,6 @@
<span class=pagination>
<% form_for @search do |f|-%>
<%= f.label :name_like, "Search" %>
<%= f.text_field :name_like, :size => 10 %>
<%= f.submit "Go" %>
<%= f.submit "Search" %>
<% end %>
</span>
2 changes: 1 addition & 1 deletion app/views/hosts/show.html.erb
@@ -1,5 +1,5 @@
<% title "Host" %>

<%= render "common/search" %>
<p>
<strong>Name:</strong>
<%=h @host.name %> (<%= @host.os %>)
Expand Down

0 comments on commit 16c11ee

Please sign in to comment.