How do I find the object with the oldest updated_at column in RJS?
- by user284194
Hello, I'm trying to remove the object with the oldest updated_at value when the rjs is executed.
page.insert_html :top, :messages, :partial => @message
page[@message].visual_effect :grow
page[:message_form].reset
Message.old_messages.each do |m|
page.remove(m.id)
end
page.delay(1) do
page.select('.message').last.visual_effect :fade
end
…