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
I am using my first project LINQ (in mvc), so maybe there's something very simple that I remember. However, a day of searching and experimenting does not work, so it works. I am trying to write a LINQ query (Linux to SQL) in which in many cases where the statement is different from an OR or an AND. We do not know how many conditions are going in the query till runtime. This search is for filter control, where the user can choose multiple criteria for filtering. Select from table where table.col = 1 or table.col = 2 or table.col = 7 .... 'Other number of conditions Before I just create the SQL query as a string, while looping over all the situations. However, it seems that there should be a good way to do this in LINQ. I tried to use Expression trees, but they had a second thought for this moment on my head, where the lambda function was to be executed inside the statement such as: values for matchingRows = matchingRows for each value Where (function (row) row.c...
I have a problem with ASP.NET MVC Ajax forms. I generate many Ajax form in a table such as: & Lt; Input type = "submit" name = "activity" value = "add activity" / & gt; & Lt;%}% & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt;%}% & gt; So far so good. When I post one of those forms, it gives a partial view in a div, and in this new partial view a new Ajax Beginnform (which is not in Genesis form) This second Ajax Beginnorf is exactly like the ones I got on the table, but when I post it, I do not get the "Ajax Post", but a normal post that sends me to a new page, I do not know whether the two Ajax forms What is the reason for the difference between, why is it the "dynamically generated" Ajax form behaves like a normal HTML form? By the way, I know that I can do it in different ways using javascript, but I would like to understand whether it can only be done using MVC helplars and Ajax lib...
I am using trk for phone debug This works well for the Holorld project But when I start the project in phone debug mode 1) the load failed 2) TrkProtocolPlugin: to target the specified file Failure (please verify If any body understands what problem I am experiencing, then this problem helps me Pre-release If the application has the privileges assigned (with the appropriate certificate) itemprop = "text" > In your case, I will check: / li> If there is no conflict of application ID with any other application of device If there are problematic commands in the installation package (for example copy copy for non-accessible directories)
Comments
Post a Comment