Displaying 1 result from an estimated 1 matches for "savingcontrol".
2009 Apr 05
5
Use a value from a different model
...<td><%=s.supplier%></td>
<td><%=s.buyer%></td>
<td><%=s.category.name%></td>
<td><%=s.subcategory.name%></td>
***** <td><%=s.purchaseType.name %></td>
the controller (saving_controller):
class SavingController < ApplicationController
def index
@category = Category.find(:all).collect {|c| [ c.name, c.id ] }
@subcategory = Subcategory.find(:all).collect {|c| [ c.name,
c.id ] }
@purchaseType = PurchaseType.find(:all).collect {|c| [ c.name,
c.id ] }
sort_order = params[:sort_by]
sort_order...