I am trying to create a live feed block that identifies the latest data added in the forum related discussion and automatically Updates a block on the second page from the latest post on that platform I am using Ruby on Rail and I would appreciate any help on this.
(If my question is not clear, I hope I can be more specific with one of these examples). I am trying to create some things like Rolling Twitter Advisory which are blog sites these days or will not mind like Twitter's home page, which automatically updates
"post-text" itemprop = "text">
This site was created by JavaScript automatically Vote on the server with XmlHttpRequests. This is possible by the setInterval function
The smallest version is something like this (jQuery but the library translation will be simple):
set interval (function () ($ .getJSON ('/ posts.json', function (post) {// code to remove old post / code to insert new post});}, 5000); < In the millisecond between
Then you can return the latest post to your post controller:
Greg Post Controller & lt; ApplicationController @posts = Post.find (: All ,: order = & gt; 'created_at desc') response_to do | format | Format.html format.json {render: jason = & gt; @post. To_json} and end
Popular posts from this blog
For my life, I can not understand why this code generates the following output ... I think there is a bug or something while using the list and lambda, if type one rectangle exposes the property and you use the included method of rectangle object ... and the clear statement proves true while Find list method fails .... Onway Code Public Gridskeyr Warldtokapadsb (Point location) {location = _Map.WorldToClient (location); Gridsquare gs = this.find (x => x.Rectangle.Contains (location)); GridSquare KP = G.Find (X => X. laxative canteen (location)); & Lt; GridSquare & gt; List = kp.FindAll (x => x.Rectangle.Contains (location)); U.dp (list.Count); Gridskare sub = KP.Fid (X => X. laxative canteen (location)); If (sub == faucet) {u.dp (place to look for "location"); U.dp ("The location found in the grid category" + GS toaster ()); U.dp ("Grid Square Bounds" + gs.Rectangle.ToString ()); U.dp ("location found in keypad" +...
I am making my own UITableViewCells with a gradient background. I have worked all the logic and drawing, but the one that I want to fix is "chunky" around the corners of my custom cell: If you have corners, you See what I'm talking about. Here is the code that I am using to generate cells: CGCTXT C = UigRxGroupCertexConnect (); CGColorSpaceRef myColorSpace = CGColorSpaceCreateDeviceRGB (); CGGradientRef myGradient = Zero; CGFloat component [8] = TABLE_CELL_BACKGROUND; CGContextSetStrokeColorWithColor (C, [[UAColor colorWithWhite: 0.7 alpha: 1] CGColor]); CGContextSetLineWidth (C, 2); CGContextSetAllowsAntialiasing (C, Yes); CGContextSetShouldAntialias (C, Yes); CGFloat minx = CGRectGetMinX (RECT), MIDX = CGRactgetMIDX (RECT), MAX x = CGTXxX (RECT); CGFloat miny = CGRectGetMinY (Rect), maxy = CGRectGetMaxY (rect); CGMutablePathRef Path = CGPathCreateMutable (); CGPathMoveToPoint (path, NULL, minx, miny); CGPathAddArcToPoint (default margin of path, NULL, mix, ...
I have an asp page (Default.aspx) that shows the difference between two text files. It has two drop down lists (respectively id = "file1" and "file2" respectively) and a button (id = "submit"). There is also a lexical control with the id "result". The content of the list button is populated based on the files present in the physical application path. Each time the submit button is clicked, I want to give the result of diff / comparison in literal control, so I have an event handler like this: protected Zero Submit_Click (Object Sender, EventArgs e) {Results.First = Comparison Files (File 1. Selected Price, File2.SelectedValue); } The problem with this is that you can not bookmark results of comparison between specific files. To solve this problem, I compare the values of the selected files as a query string for the added URL and made a redirection. And so, the above event handler has been changed to look like this: Protecte...
Comments
Post a Comment