1. Nginx Installationsudo apt-get install Nginx2. Ruby Installationsudo apt-get install RubyView version Ruby-v3. Rails Installationsudo apt-get install RailsView version Rails-v4. MYSQL InstallationSUDP apt-get Install Mysql-server myusql-clientLog in to MySQLMysql-uroot-pCheck the port occupied by the MySQL serverNET
View
View is divided into builder mode and rhtml mode.
The following is an example of the builder mode.
XML. Div (: class => "productlist") DoXML. timestamp (time. Now)@ Products. Each do | product |XML. Product doXML. productname (product. Title)XML. Price (product. Price,: currency => "USD ")EndEndEnd
If the tag and built-in method are repeated, you can use something! () To generate tags
Rhtml is similar to JSP.
The H method provides HTML EncodingHelper
Xxxcontroller correspon
D:ror directory (the directory is built by me, the reader can freely )Install MySQL for Ruby driver, command line type: Gem install Mysql-2.8.1.gem6. Go to http://download.csdn.net/detail/luoyeyilin/3614807 download Instantrails-2.0-win.zip extract, search under mysql.so,80k size file Copy the mysql.so to the C:\RUBY\LIB\RUBY\SITE_RUBY\1.8\I386-MSVCRT.You can th
Lin Shi, a friend of mine, recommended a web development tool: Ruby. He went to his side in the morning and demonstrated it. It was amazing! As long as you define a database table, regardless of ms SQL and MySQL, the rest of the work is about the rails framework. Let's take a look at the self-contained page of the rails framework. One word can be used to describe
Tags: railsThere are 11 chapters in total, a simple Weibo system.The development is driven by testing, so there are a lot of test code in the book. At the beginning, I felt very uncomfortable. After a while, I still don't like this development method. Finally, I chose to organize the knowledge points in the book in my own way. That is to say, I separate the development part from the test part. After thinking about it, I think the knowledge points can be divided into the following four points.1.
Download the integration pack: http://railsinstaller.org/en the rest of the little things other tutorials can also be found, here is not much to say.
After installation, open the Rbreadline.rb file under ruby2.1.0\lib\ruby\site_ruby\2.1.0 in the installation directory, which can be opened using Notepad. Then change require ' DL ' to require ' findle '
Open the command line and execute the following command
$ gem Sources--remove https://rubygem
Website development pay attention to is the efficiency, can put an idea in the shortest time to achieve, often easy to occupy the opportunity. While the development of Ruby on Rails is highly efficient, it is not a pleasant thing to do if each development site needs to start from scratch with the tedious basics of registering, logging in, rights management, and forgetting passwords. The following code allow
Many documents describe how to use the gem (one-click Ruby installer is already included, and you can use the gem after installation) for Remote Installation. If the network is poor, the installation will fail. I can see an article on the Internet that describes the local installation method. Now I will summarize the installation process for you.
First download them from rubyforge.net (the version may be updated during download)
Activesupport-1
; class:"Control-label"%> class:"Form-control"%> class="Form-group"> class:"Control-label"%> "if",class:"Form-control"%> ifDevise_mapping.rememberable? -%> class="Form-group"> class="Actions"> "Login",class:"btn Btn-primary"%> "Forgot Password", New_password_path (resource_name),class:"btn Btn-link"%> (8) In order to protect our methods, add a login check before each method app/controllers/application_controller.rbclass Applicationcontroller actioncontroller::base # Prevent CSRF attacks by ra
1, Purpose: Use Heroku to deploy the development environment to the production environment. Heroku is dedicated to deploying rails and other Web applications, and the process of deploying rails applications is straightforward-as long as the source code is incorporated into the GIT version control system.2. Build Heroku Deployment Environment(1) Heroku use PostgreSQL database, so to add PG to the production
We've already completed a simple shopping cart, and from this start we'll see how to test in rails.
When we created the shopping cart program in our depot directory, there is already a test directory, which is for us to test preparation. So far, we've seen that the fixtrues and Functional,unit directories inside have a test file that corresponds to the controller and model.
We first Test products this model. Code test\unit the product_test.rb file i
Rails built log functionality, or more precisely, rails exposes the Logger object, which can be used in all rails programs.
Logger is a simple log frame ported from Ruby (you can type RI logger to view the documentation of the standard library in Ruby's command line), and for us, we just need to know that logger can t
After several days, the Ror environment was finally ready. In order to prevent future forgetting and minimize detours, we made a special record
========================================================== =====
Installation Process
1. Install rubyinstaller-1.9.2
2. install and execute gem install rails
3. Download dev kit and decompress it to the ruby installation directory.
4. Install Netbeans 6.9.1
5. Enabl
Http://www.songlin51.com/archives/667.html
Ubuntu 12.04 redmine2.1 installation record
When you install gem install rails, you cannot connect to rails.
Solution: Search for railson http://rubygems.org/gems/railsto download rails. gem for installation.
An error is reported when installing gem install mysql2.Building native extensions. This cocould take a while
Ruby is indeed very popular, and the network is so popular that I can't help but be impulsive. I found some information to study it and shared it with you.
Build a Ruby on Rails environment in Windows
Install Ruby:Download the http://www.ruby-lang.org/en/ from the ruby182-15.exe and install Ruby.Add the environment variable [installation directory]/bin to path
Here's how to fix this annoying Ruby on Rails popup message: "The program can ' t-start because Msvcrt-ruby18.dll is missing From your computer. Try reinstalling to fix this problem. "
This is fix applies if you are using cucumber on Windows.It turns out the ' error message ' is related to the JSON gem, that Cucumber depends. The details and solution are buried in Thisthread.
To fix it, your just have to ru
Let's take a look at some tips for debugging this time.
First, and most importantly, writing test code, writing unit tests and functional tests in rails is simple, using them to reduce the rate of bugs, or to avoid bugs in your previous code.
The test code tells you what works and what doesn't, and the test code helps you isolate the problematic code, because sometimes the bug doesn't show up quickly.
If the problem occurs in a model, we can use th
A Brief Introduction to Ruby on Rails's support for PostgreSQL array types, railspostgresql
I am very happy to announce that Rails 4.0 now supports PostgreSQL array types. you can easily create fields of the array type through: array => true in migration. you can also add other options (length, default, and so on) when creating an array field)
create_table :table_with_arrays do |t| t.integer :int_array, :ar
Modify viewsModify the index view (app/views/posts/index.html.erb) and add the edit link as follows:That is, add the following logic: Among them, Edit_post_path, is the previous "[Ruby on Rails] and I learned route map" referred to the edit action prefix added a shortcut after the _path suffix, can accept parameters, here accept the post instance object.Then edit the view and copy the new view as an edit v
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.