When it comes to Ruby, it's just a reflex to think of rails, which seems to have only one use for Ruby, rails. Although I didn't write rails, I thought the Ruby language itself was far more attractive than the third-party framework of rails. It is a
Using form to create data, this section will cover the content: Create form, redirect user, render views and flash messages.1. Views PreliminaryEdit App/views/posts/index.html.erb This view file as follows: New_post is the new action's prefix,
Https://github.com/sstephenson/rbenv
Check out rbenv into ~/.rbenv .$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
Add to your for access to the ~/.rbenv/bin $PATH rbenv command-line utility.$ Echo ' Export path= '
Steps 1Install homebrew, install the package required for the system through itRuby-e "$ (curl-fssl https://raw.github.com/mxcl/homebrew/go/install)"After the installation is complete, brew doctor self-TestSteps 2Installing Curl-l Https://get.rvm.io
I've been working on Ruby for a while and have recently had some leisure events, learning about Ruby and preparing for future Ruby on Rails development.Ruby was founded in 1993 by as of Japan (まつもとゆきひろ/yukihiro Matsumoto). In contrast to chatty's
An object consists of a group of instance variables and a class reference.
Object methods exist in the class to which the object belongs (from the class perspective, they are called instance methods ).
The class itself is the object of the
Some websites collected by Ruby on Rails during this time. I personally feel good. If you are interested, please check them out.
Infoq
Codebetter
Napcsweb
Riding
Rails
Rubyonrails
Taoxi
For Ruby introduction, see: http://www.ruby-lang.org/zh_CN/about/
I. IRB
Interactive Ruby help and consoleProgramIn Windows.
You can directly execute Ruby in IRB.Code. For example:
Code highlighting produced by Actipro CodeHighlighter
My memory has been poor and I need to take a look at it. Today I will look at Ruby's object-oriented programming content and write down some of these concepts for future reference.
Basic concepts:
I. Local variables, global variables, instance
Ruby has the function facility to execute code saved as strings at runtime, the eval family method. Including kernel # Eval, object # instance_eval, Module # class_eval.
Kernel # eval
It is the most direct method
As follows:
1 p eval("2+2")2 3
For detailed documentation, you can click the official instructions on GitHub, which is only an English version.
Https://github.com/thoughtbot/shoulda-matchers
Shoulda-matchers provides test: Unit-And rspec-compatible one-liners that test common
The use of Block and iterator in Ruby is explained by rubyblock.
Let's briefly describe a unique feature of Ruby. Block, a code Block that can be associated with a method call, almost like a parameter. This is an incredible feature.
You can use
Common Ruby file operation code instances and ruby code instances
# Create a 222. rb file and the input character File = file. open ("222.rb"," w + ") file. puts "123 \ nwadwa \ n12124124 \ ndwdw" file. close # output 222. rb content File. open ("222
The two differences between proc and lambda IN Ruby: proclamloud
1. In proc and lambda, the return keyword has different meanings.:In proc, return only indicates returning from this lambda.In lambda, return is not returned from proc, but from the
Use Ruby to write a simple tutorial for sending emails.
SMTP (Simple Mail Transfer Protocol) is a Simple Mail Transfer Protocol. It is a set of rules used to send Mail from the source address to the destination address, which controls the Transfer
Ruby-based watir-webdriver Automated Testing Solution and implementation (5), watirwebdriverThen the Ruby-based watir-webdriver Automated Testing Solution and Implementation (4)Http://www.cnblogs.com/javame/p/4164570.htmlcontinue ...... for special
Ruby-based watir-webdriver Automated Testing Solution and implementation (3), watirwebdriverThen the Ruby-based watir-webdriver Automated Testing Solution and implementation (2)Http://www.cnblogs.com/javame/p/4259468.htmlcontinue... to write a
Examples of jquery checkbox operations and jquerycheckbox operations
Checkbox operations
1. Select all or none
2. Print all selected items
select all, not select all apple bananas
Jquery operations on checkbox
Your
1. quickly obtain the matching value of a regular expression
We usually use a regular expression to match the expression first and then obtain the result, but sometimes an exception is thrown. See the following example:
Copy codeThe Code is as
Is there such a problem in the application of computer languages? Python usage is much higher than ruby usage. If you want to know why the proportion of people who select the former is large, read the following article! I hope you will gain some
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.