> got this error [rails 2.3.2, Ruby 1.8.7] > > > syntax error, unexpected tIDENTIFIER, expecting kEND > ... if n.send(order_attribute) > self.send(order_attribute) > > idoesn't like the '>' ... what's wrong ? > > > here is my action... > > def move_to_ordered_child_of(parent, order_attribute, > ascending=true) > if parent > left = nil > parent.children.each do |n| > if ascending > left = n if n.send(order_attribute) < self.send > (order_attribute)
Try... left = n if ( n.send(order_attribute) < self.send ) > else > left = n if n.send(order_attribute) > self.send > (order_attribute) > end > end > self.move_to_child_of(parent) > if left > self.move_to_right_of(left) > elsif parent.children.count > 1 > self.move_to_left_of(parent.children[0]) > end > else > self.move_to_root > end > end > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

