Tag:Rails

  • Notes on Ruby on rails (the whole process of installation and use)

    Time:2020-3-27

    There is a chance to try rails again, but the original contact is 2, now it has become 4, it seems that the installation will be faster than the original.. Rails 4 installation For RVM installed Copy codeThe code is as follows: gem install rails If not, it should be like this: Copy codeThe code […]

  • Examples of rails scaffolds

    Time:2020-3-8

    Scaffolding is a very easy way for rails. Some simple additions, deletions, modifications and checks can be realized, which saves us unnecessary trouble. So how to use rails scaffolding? Let’s talk about it today. . specify the port to start the rails project Copy codeThe code is as follows: ruby script/server webrick -p 3000 0. […]

  • Rails creates an application instance

    Time:2020-3-6

    After installing the rails framework, you also get a new command-line tool: rails. This tool can be used to construct each new rails application. Why do we need such a tool – I mean, why not copy the most handy editor and write every line of code for the application from scratch? Er… We can […]

  • Analysis of query operation and method of rails common database

    Time:2020-3-5

    1. Get data Get the first and last record Copy codeThe code is as follows: Model.first Model.first(options) Model.find(:first, options) Model.last Model.last(options) Model.find(:last, options) Get records by ID Copy codeThe code is as follows: Model.find(1, 10, options) Model.find([1, 10], options) .find all Copy codeThe code is as follows: Model.all(options) Do the same for a set of […]

  • Brief summary of common operation commands on rails command line

    Time:2020-3-4

    New class Copy codeThe code is as follows: Ruby script / generate model < class name > < field 1 >: < type > ruby script/generate Model Item name:string age:integer Remove class Copy codeThe code is as follows: ruby script/destroy Model New controller Copy codeThe code is as follows: Ruby script / generate controller < […]

  • On the strong parameters mechanism in rails 4

    Time:2020-3-2

    To understand the strong parameters mechanism in rails 4, first let’s look at the parameters in rails 3 When you create or update an active record object in rails 3, there are security issues with mass assignment. Therefore, a white list is required in the model to declare which attributes can be updated by parameter […]

  • Learn about Ruby (RVM, gem, bundle, rake, rails, etc.)

    Time:2020-2-29

    Ruby I don’t need to talk about that RVM It is used to help you install the ruby environment, manage multiple Ruby environments, and manage which Ruby environment on the machine is used by each Ruby application you develop. Ruby environment is not only Ruby itself, but also the third-party Ruby plug-ins. All are managed […]

  • A detailed explanation of various caches commonly used in Web Applications

    Time:2020-2-27

    In this paper, nginx, rails, MySQL and redis are used as examples, and other web servers, languages, databases and caching services are similar.The following is the schematic diagram of the third floor for subsequent reference: 1. Client cache A client often accesses the same resource, such as using a browser to visit the homepage of […]

  • Fast and correct installation of ruby and rails running environment

    Time:2020-2-13

    How to install Ruby and rails running environment quickly and correctly For new developers, how to install ruby, the running environment of ruby gems and rails may be a problem. This page mainly introduces how to use a reliable way to quickly install Ruby development environment.The secondary installation method is also applicable to the product […]

  • Install and deploy Ruby on rails application on Ubuntu 12.04 server

    Time:2020-2-12

    This tutorial is only suitable for Ubuntu server to deploy projects online. It is recommended to use the same Ubuntu version to avoid problems caused by different versions. This tutorial is suitable for beginners to deploy rails applications for the first time; This article tests the passing environment Ubuntu 12.04 Server, The server installation is […]

  • Simple comparative analysis of Ruby on rails and laravel

    Time:2020-2-8

    At present, there are many popular frameworks for online web application development. There are also many different types of frameworks, such as those with a large number of plug-ins, which can let you iterate more quickly (such as rails), or other very simple and low-level (such as flask)Two relatively more popular frameworks in web application […]

  • Win7 install Ruby on rails development environment

    Time:2020-2-6

    PrefaceMany articles have said that Ruby environment is very difficult to build on windows, and there will be a variety of strange problems, so it is recommended to install and develop on Linux and MAC. But I followed the tutorial, and the problem was not too much. It took about two and a half hours […]