Search Results

Search found 2 results on 1 pages for 'zind'.

Page 1/1 | 1 

  • Jquery html grab + calling a controller action using javascript (ruby on rails)

    - by Zind
    Preface: I consider myself "slightly effective" in ruby on rails, and a complete novice in javascript. Also, yes, I have installed jQuery and associated plugins instead of the default Prototype library. I am in a situation where I am pulling in a table from off-site in an iframe (which is taking care of all internal JS for me) such that when a part of the table is clicked, a td will gain the class "active." What I would like to do is take this info (I'm assuming I can get it in a string format), and pass it to a method (in my controller, I'm assuming) which will parse the html, pull out the pertinent info, and then call a creation method in the same controller with the parsed info, the end result being a new item in that table. What I have so far is javascript which I believe is correct so far: <script type="text/javascript"> var ImportInfo = function() { var info = $('td.active').html(); // call controller action which parses the given string, //checks for existence in database, and adds new row if needed } $("#Import").click(ImportInfo); </script> and, of course, a button with id="ImportLocation." I have looked at this question: http://stackoverflow.com/questions/1334447/using-jquery-to-call-a-controller-action but am somewhat unsure as to how to call a controller action to pass the contents of the td as a string. Is this doable with the jQuery post method?

    Read the article

  • Database schemas WAY out of sync - need to get up to date without losing data

    - by Zind
    The problem: we have one application that has a portion which is used by a very small subset of the total users, and that part of the application is running off of a separate database as well. In a perfect world, the schemas of the two databases would be synced up, but such is not the case. Some migrations have been run on the smaller database, most haven't; and furthermore, there is nothing such as revision number to be able to easily identify which have and which haven't. We would like to solve this quandary for future projects. During a discussion we've come up with the following possible plan of action, and I am wondering if anyone knows of any project which has already solved this problem: What we would like to do is create an empty database from the schema of the large fully-migrated database, and then move all of the data from the smaller non-migrated database into that empty one. If it makes things easier, it can probably be assumed for the sake of this problem specifically that no migrations have ever removed anything, only added. Else, if there are other known solutions, I'd like to hear them as well.

    Read the article

1