what's wrong ... syntax error ... unexpected identifer ..

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

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 )

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 )

It is not that line that is blowing up, it is the one below with '>' Colin

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 )

It is not that line that is blowing up, it is the one below with '>'

Heh. Good point. Same thing would apply below though... Assuming
like someone else said that it is this piece of code and not some
other ">" somewhere...