Thanks for taking the time to read this!
Well, this is what I am trying to do, I have Rails app that displays a table displaying some information in the database, and I need it to automatically reload the table (if possible in a partial reload, so I don’t have to reload the whole page.) When new data is added to the database.
Thanks in Advance!
So that the table data can reload, you’ll have first to notify th client the content has changed, then actually reload the content. To achieve that you’ll have to use Javascript/Ajax on the client side :
timestamp in JSON
jQuery ships with Rails and will handle the Ajax part very efficiently. See jQuery.ajax and jQuery.replaceWith to replace the old content with the new one.
On the controller action that provides the table, use a parameter so that you can disable the layout rendering when called from Ajax. This way the controller will only provide the relevant content (the view containing table).