RAILS 4 on Ruby AJAX implementation process

Source: Internet
Author: User
Tags svn update install node

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.