Welcome To Snipplr
Everyone's Recent Ruby Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Easy way to add belongs_to association to nested forms in Rails
0
1739
posted 16 years ago by viatropos
Credit: http://pragmatig.wordpress.com/2009/04/14/recursive-symbolize_keys/
0
1488
posted 16 years ago by nate63179
Fetches an RSS feed and displays the title and summary of each entry. Nothing fancy.
0
1375
posted 16 years ago by PhilK
Simple example for using ActionMailer with Gmail (or other hosts if you remove the TLS settings).
0
1466
posted 16 years ago by PhilK
Ruby provides a platform independent way of displaying file paths. Here are a few common ways to show absolute and relative paths.
0
1713
posted 16 years ago by chrisaiv
This shows how we can find objects inside code blocks (aka data sets).
0
2297
posted 16 years ago by chrisaiv
Inserted at the top of the method body, this line creates instance variables for each of the method parameters and sets them to their respective argument values.
0
1855
posted 16 years ago by pmadden
The shell command which provides documentation for Ruby's classes and methods is:
0
1356
posted 16 years ago by deepsoul
This assumes the modules names are CamelCase and not UPPERCASE.
0
2292
posted 16 years ago by blasterpal
Groovy has the as keyword which enables the implementation of a Java interface by using the as keyword, its quite easy to mimic this in JRuby.
0
1920
posted 16 years ago by narkisr