Created
February 21, 2013 00:27
-
-
Save evnpr/5000947 to your computer and use it in GitHub Desktop.
poll function in server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def poll | |
last_post = params[:last_post] | |
def check | |
r = Post.all.order(:created_at => "ASC").last | |
if r.message != last_post | |
return true | |
else | |
return false | |
end | |
end | |
while check == false | |
//no need to do anything | |
end | |
//send json to be used on front end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment