2009/6/19 Erwin <[email protected]>: > > > 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) > 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
It does not give me a syntax error. Try putting it as near the start of the file as possible in case the error is actually earlier in the file but not picked up till here, though not sure what that could be. Colin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

