Ruby on Rails-highlights in details

Source: Internet
Author: User
Tags ruby on rails website
Ruby on Rails ...... It has nothing to do with. net ...... The homepage is for more people to access Ruby on Rails ...... Withdraw tomorrow ...... Http://www.blogwind.com/Wuvist/16993.shtml
By the way, I use Mac, and the cute editor used in blog Park has become a text area in safari. However, the latest version of cute editor is already compatible with safari to some extent ......

After reading the video on the official Ruby on Rails website, I was attracted by it. At that time, I made a bunch of online articles on Ruby/Ruby on Rails.

However, the video, a blog engine in 15 minutes, looks really cool ...... Development efficiency is indeed fast, but it just looks like it ...... It is far from enough to persuade programmers to use Ruby on Rails to do things ...... Too many details are not mentioned ...... This seems to be the only Chinese tutorial. They just make Ruby on Rails look pretty ...... Nothing substantive ...... Recently I have been reading a detailed tutorial on Ruby on Rails: Agile web development with rails (English version, Chinese translation does not know that the monkey year and month can only come out ......) At present, it seems that half of the time is faster, which is deeply attracted by Ruby on Rails ...... The book consists of three parts: The first part "Getting started" is just how to install Ruby on Rails ...... First, talk about windows, then talk about Linux/Mac ...... Obviously, Ruby on Rails is intended to attract programmers in windows ...... However, it leaks a very important part, that is, how to run rails on IIS ...... But this is a very practical problem ...... Run the web application in windows, either ASP or Asp.net, or IIS ...... If PHP is run under Apache, most of the servers are Linux ...... Maybe the author doesn't want to miss it either, but there is no official solution ...... Although someone has already installed rails on IIS ...... The link ms SQL method mentioned in the book is also problematic ...... At least, there is a problem on my computer ...... But I have fixed it ...... When can I write the solution ...... Rails on IIS is also useful for fast CGI ...... I have not performed stress tests, but it seems that it is still feasible to use it as a website ...... The second part is "buiild an application ...... Let me see a lot of details ...... The tutorial is very easy to read ...... Imagine a customer asking for a shopping website ...... From the user requirement analysis, the program passes the test ...... The tutorial not only shows how to use Ruby on Rails to build websites, but also shows the whole process and way of thinking about websites ...... Analyze requirements, discover problems, and find solutions ...... The tutorials also often show problems that may occur during the development process ...... Describe the cause of the error, and then describe the correct solution ...... This is a good teaching method ...... To learn a thing, you must not only know it, but also know it ...... While presenting the problem, explaining the "correct solution" can also better reflect Ruby on Rails's highlights in dealing with these problems ...... I was particularly surprised by the details in the tutorial ...... Add the "-" sign before "%>. For example, there is such code: <% for I = 0 to 10-%> Hello world! <Br> <% end for %> after "-" is added, extra spaces and blank lines are removed ...... That is to say, the final HTML code is continuous Hello world! <Br> Hello world! <Br> ...... Instead of: Hello world! <Br> Hello world! <Br> ...... This is almost trivial detail ...... Because the browser's final display will not be affected no matter whether redundant blank spaces exist or not ...... Although the removal can reduce the size of the final HTML page, the current bandwidth does not care about the difference ...... Adding these spaces to the source file makes it more important for developers to read them ...... In fact, vs.net also modifies the aspx code to make it easier to read ...... However, I have encountered such a problem: 1. Manually remove all the spaces and blank lines on an ASP page ...... Because the loop output in that file is hundreds of times ...... The size is halved after removal! 2. On an Asp.net page, I need to get the content of a template item in the DataGrid ...... The space and blank lines automatically added to me by vs.net are also obtained by the program, making the program wrong ...... I am afraid to use vs.net to open the file ...... Otherwise, you must re-use editplus to open the file and remove spaces and empty rows ...... A small "-" perfectly solves this problem ...... I strongly felt that rails was designed by senior web programmers ...... During their design, they considered many details that may be encountered in many web development projects ...... In addition, they have integrated their years of development experience into rails ...... Read the second part of the book ...... In order to realize how "convention over configuration convention is higher than configuration" and "dry-Don't repeat yourself does not repeat yourself" reflects its advantages in the actual development of Ruby on Rails ...... These two points are often mentioned when I look at Ruby on Rails ...... However, they all lack the support of actual examples ...... The examples in the book show Ruby on Rails to the fullest ...... They emphasize an excellent development method ...... The Convention/Convention accepted by rails is a good convention adopted by designers during development ...... To put it bluntly, it is a default configuration and is a widely used configuration ...... By following this, we can ensure a good style of the program ...... In addition, it saves us a lot of redundant and repetitive code ...... This can greatly improve the development speed ...... Dry ...... Yes, you should not repeat yourself ...... However, if this is achieved? How can we use existing things? Oo is to avoid repetitive work ...... However, when I write a program, I often do repetitive things ...... This tutorial tells the readers where they are repeated, which can be avoided and how to avoid them ...... In fact, to achieve this, it is important to have an excellent framework ...... The framework must support the implementation of "dry ...... The tutorial is to reflect the efforts of the rails framework ...... It also emphasizes the importance of MVC ...... What should be done in the model ...... What should be done in the view ...... What should be done in controller ...... Everything is clear ...... How to return errors and add links ...... The actual introduction ...... It is not only quick but also beautiful in design to teach readers how to add proper code in the right place ...... At least, myself ...... When creating a webpage, the path "/..." is always hard-coded, which makes the website messy after being changed from the root directory to the subdirectory ...... Too many details ...... I used to develop a website and solved it in an ugly way ...... While reading the tutorial, I found that the rails designers noticed these details and provided a good solution in rails ...... The third part of the book is: the rails framework also occupies more than half of the book ...... Not reading ...... I believe that two days later, we will be excited by the excitement of rails ......
Related Article

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.