Skip to content

Commit

Permalink
ganti method search salesmen_id jadi employeeid di purchaseorder
Browse files Browse the repository at this point in the history
  • Loading branch information
retarocks committed Mar 15, 2012
1 parent 044acdb commit 4bf4b0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/controllers/purchaseorders_controller.rb
Expand Up @@ -11,8 +11,8 @@ def index
end

def search
paramspurchasenumber = params[:purchasenumber]
@purchaseorders = Purchaseorder.find(:all, :conditions=>{:purchasenumber=>paramspurchasenumber})
salesmen = Salesman.find(:all, :conditions=>{:employeeid=>params[:employeeid]})
@purchaseorders = Purchaseorder.find(:all, :conditions=>{:salesmen_id=>salesmen})
respond_to do |format|
format.html { render :index }
format.json { render json: @purchaseorders }
Expand Down
4 changes: 2 additions & 2 deletions app/views/purchaseorders/index.html.erb
Expand Up @@ -32,6 +32,6 @@
<%= form_tag({:controller =>"purchaseorders", :action=>"search"}, :method => "get") do %><%# form dengan get %>
<%# form_tag(:controller =>"purchaseorders", :action=>"search") do %><%# form dengan get di route nya harus di ganti juga %>
<%= text_field_tag(:purchasenumber) %>
<%= submit_tag("Search Purchase Number") %>
<%= text_field_tag(:employeeid) %>
<%= submit_tag("Search Employee ID") %>
<% end %>

0 comments on commit 4bf4b0b

Please sign in to comment.