Useful Iterators and Methods for Ruby on Rails
When you want to travel through the items in a database you created with Ruby on Rails, knowing the iterators to use is key. The following table shows helpful iterators and methods:
| [1, 2, 3].each { } |
=> [1, 2, 3] |
| [1, nil, nil, 2, 3, nil].compact { } |
=> [1, 2, 3] |
| [1, 2, 3].delete_if { |x| x >= 3 } |
=> [1, 2] |
| [1, 2, 3].collect { |x| x + 1 } |
=> [2, 3, 4] |
| [1, 2, 3].find_all { |x| x % 2 == 1 } |
=> [1, 3] |
| [1, 2, 3].reject { |x| x % 2 == 1 } |
=> [2] |
| [2, 5, 1, 0, 7].sort |
=> [0, 1, 2, 5, 7] |
| [2, 5, 1, 0, 7].max |
=> 7 |
| [1, [2, 3]].flatten |
=> [1, 2, 3] |
| [1, 2, 3].empty? |
=> false |
| [].empty? |
=> true |
| [0, 5, 9].length |
=> 3 |
| [1, 2, 3].include?(2) |
=> true |
| [1, 2, 3].include?(16) |
=> false |
| [1, 2, 3].reverse |
=> [3, 2, 1] |

Web Design & Development Glossary
AJAX
asynchronous JavaScript and XML. A technique used in web page development.

Web Design & Development Glossary
API
application programming interface. A set of rules programs use to communicate with each other.

Web Design & Development Glossary
color stop
A special element that indicates a color to be added to a gradient.

Web Design & Development Glossary
FTP
File Transfer Protocol. A network protocol useful for transferring files in a client-server relationship.

Web Design & Development Glossary
HTML
HyperText Markup Language. The predominant language for building web pages.

Web Design & Development Glossary
HTTP
HyperText Transfer Protocol. The primary networking language for the Internet.

Web Design & Development Glossary
PHP
PHP Hypertext Processor. A scripting language that works well within HTML.

Web Design & Development Glossary
socket
A technology that allows remote computers to maintain a persistent connection in order to communicate with each other.

Web Design & Development Glossary
sprite
An graphic object on a web page that will be manipulated in real time.

Web Design & Development Glossary
SQL
Structured Query Language. A programming language useful in managing relational databases.

Web Design & Development Glossary
stateless protocol
An Internet procedure that completely breaks the connection between the client and the server after a transaction, meaning that the next transaction will require an entirely new connection.

Web Design & Development Glossary
Telnet
A network protocol useful in interactive, text-oriented communications.

Web Design & Development Glossary
W3C
World Wide Web Consortium. The organization that sets international standards for the World Wide Web.