Displaying 2 results from an estimated 2 matches for "tangren".
Did you mean:
  langren
  
2006 Jul 20
3
sort_by with via a parent models child
I am having a problem with ruby''s sort_by function.  I want to sort a 
list of parent model objects based on the children of the parent models.
Normally you might say sortedList = modelList.sort_by { |model| 
model[''someAttribute''] }
What I am tring to do is
sortedList = modelList.sort_by{ |model| model.children.find(:first, 
order=>"price desc"  ).price}
2006 Jul 14
1
passing an entire hash to an action
Is it possible to pass the entire contents of a hash to an action via 
link_to_remote?
I know that when you want to pass a value you say link_to_remote("link 
name", :url => {:action=>"some action", :someName => someVal} )
This works for when you want to pass strings but I want to be able to 
pass a reference to a list of models that is stored in a hash to the