XXX, recently clumsy in writing an automated SVN update for the Web operations Small platform,
This decision was implemented with rails 4.
But because the textbooks on the Web are implemented in versions 3 or 2. So this time made a lot of detours, now summarized as follows:
The relevant view code:
<div> This update of the SVN version of the command:<%= @svn_update_cmd%><br> " view full log " 'svnlog_out'"svnlog_out"> </div>
Related controller code:
class Svnupdatecontroller < Applicationcontroller respond_to:html,: JS def svnlog_out = ' Cat/xxx/svn_current.log '. Split ("\ n") endend
Related to. Msi ERB
$ ("#svnlog_out"). HTML ("<%= J (Render ' svnlog_out ')%> ");
The associated output view
<% @svnlog_out. Each do |line| %><%= Line%><br><% End%>
Finally, pay attention to yo ... Run this Ajax on Rails, install node. js or Exejs server-side stuff, otherwise, the startup will be wrong, or after the comment, Ajax should not yo.
~~~~~~~~~~
To a small figure shuangshuang,, hehe, today testing the first version of the update, is OK.
Your sister's, is Bootstrap let me write, too embarrassed me,,
You can use it, it's internal anyway.
RAILS 4 on Ruby AJAX implementation process