Recently, I was working on a project using the rails framework and the ruby language. I personally don't feel very useful, and there are many problems with the framework and language.
Today, I encountered a very strange problem.CodeWIN32API is
A little more complexCodeIt is easy to get dizzy by the Representation Methods of various Ruby conventions.
(If the first part of the identifier is a lowercase letter or "_", the identifier is a local variable or method call .)
(An identifier
ArticleDirectory
1. Install thin
2. Start and Stop thin
3. Cluster
4. runlevels
5. Run rails
1. Install thin
Gem install thin
He will need some gem support.
Rack-0.9.1Eventmachine-0.12.6Daemons-1.0.10Thin-1.0.0
Of
Arr = [1, 2, 3]
1) arr2 = arr. each {| element = element * 2} # Both arr and arr2 are still equal to [1, 2, 3] each. The changes to elements in the original array traversal are not saved.2) arr2 = arr. map {| element = element * 2} # arr is equal
My environment is Ruby 1.9.2p290 + rails2.3.4 + mysql5.5.15. When I run "DB: migrate", the error message is as follows:!!! The bundled mysql. RB driver has been removed from rails 2.2. Please install the MySQL gem and try again: Gem install
Chapter 2 Ruby Data Types
Number: If fixnum is out of the range, it is automatically converted to bignum. Numeric is the base class for all numeric types, float and integer are the subclasses of numeric, and fixnum and bignum are the
Class fixnum attr_accessor: valueendx = 1 p x. object_idx.value = "anleb" P x. value. object_iddef change (x) P x. object_id p x. value. object_id x = 2 # pointer change X. value = "mr. W "P x. object_id p x. value. object_id # x pointer changed
From: http://hi.baidu.com/waytofall/blog/item/dad928f9d042b65f242df222.html
Introduction to the MVC Architecture in Ruby on Rails
MVC was first proposed by Trygve reenskaug (seemingly a Norwegian, Professor at the University of Oslo,
In Ruby, the so-called block-based method refers to the abstraction of the control structure. It was initially designed to abstract loops, so it is also called an iterator.Syntax: method_name do... end or method_name {}
1
#
Block call
Life cycle:
Yukihiro Matsumoto was born on February 1, April 14, 1965 in Tokushima Prefecture, Japan. In 1984, he studied at the Department of Information, the third discipline of zhubo University. Two years later, I will be absent from school and
Objects and attributesThe song object we created has an internal State (such as song title and artist ). This state is private to other objects-other objects cannot access the instance variables of an object. Generally, this is a good thing. This
Mailfactory is a simple mail package on rubyforge. With this package, we can easily send emails with attachments and HTML formats. However, currently, mailfactory has some problems in Chinese support, A patch is required.
Install mailfactory
Unlike Java, Ruby does not support Unicode internally (it is said that Unicode is supported by 2.0, but not confirmed)In character encoding, Ruby uses the iconv library of Open Group. This library appears to be available by default in Linux, but
In the previous blog, such code 1 class songlist was used.
2 def [] (key)
3 return @ songs [Key] If key. kind_of? (Integer)
4 return @ songs. Find {| Asong. Name = key}
5 end
6end
In the fourth row, a method such as find can traverse the songs
Http://developer.51cto.com/art/200703/41243.htm
Introduction
This is a short Ruby entry, and it takes only 20 minutes to complete. Here we assume that you have installed Ruby. If you have not installed Ruby, visit the official Ruby website to
Http://article.yeeyan.org/view/52654/18184
Rack provides interfaces between the Web server and the ruby development framework. It frees framework writers from the heavy burden of writing a processing module for each web server, saving a lot of
ATTR _ * in ruby _*
In Java, get and set are used to assign values to and read variables.
In ruby:
Read:
Def name @ nameend
Assignment:
Def name = (myname) @ name = mynameend
You can use attr_reader and attr_writer, or attr_accessor.
For
1. Win32ole
2. Rails plug-in Collection
3. How to Write a simple Rails Plugin
4. Create your own error message in Rails
5. Enhance the Automatic completion function of irb (words completion)
Irb-r irb/completion
6. Document
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