Welcome To Snipplr


Everyone's Recent Ruby Snippets



1 2 3 4 5 6 ... 12
This Ruby script generates the [Gnome Terminals For Rails script](http://snipplr.com/view/32227/gnome-terminals-for-rails/ "Gnome Terminals For Rails").
0 44 posted 10 years ago by draq
0 64 posted 10 years ago by inkdeep
0 134 posted 10 years ago by inkdeep
0 53 posted 10 years ago by inkdeep
0 72 posted 10 years ago by sai-venkat
1 55 posted 10 years ago by wdso
Easy way to add belongs_to association to nested forms in Rails
0 96 posted 10 years ago by viatropos
Credit: http://pragmatig.wordpress.com/2009/04/14/recursive-symbolize_keys/
0 63 posted 10 years ago by nate63179
Sniffing http request & response using pcap in Ruby.
2 77 posted 10 years ago by narkisr
Fetches an RSS feed and displays the title and summary of each entry. Nothing fancy.
0 67 posted 10 years ago by PhilK
Simple example for using ActionMailer with Gmail (or other hosts if you remove the TLS settings).
0 73 posted 10 years ago by PhilK
Don't forget to use require 'directory/name_of_class'
0 122 posted 10 years ago by chrisaiv
0 79 posted 10 years ago by chrisaiv
1 155 posted 10 years ago by endorfin
Ruby provides a platform independent way of displaying file paths. Here are a few common ways to show absolute and relative paths.
0 82 posted 10 years ago by chrisaiv
I had an XML file that I needed to convert to CSV. In order to make things easier for myself, I used a pipe | symbol instead of a comma so that there would be no parsing errors later. I also ended up writing the file to a Txt file and importing it...
1 165 posted 10 years ago by chrisaiv
This shows how we can find objects inside code blocks (aka data sets).
0 121 posted 10 years ago by chrisaiv
1 64 posted 10 years ago by shiftyjelly
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 86 posted 10 years ago by pmadden
1 2 3 4 5 6 ... 12