1 2 3
def validate_permalink(attr_name) permalink = sanitize_permalink( permalink?? attr_name : permalink ) end
1 2 3
def validate_permalink(attr_name) self.permalink = permalink? ? sanitize_permalink(attr_name) : sanitize_permalink(permalink) end
1 2 3 4
#!/usr/bin/env ruby require 'fileutils' ...
Ruby On Format to readable XML
by Richard Liverant,
March 14, 2010 23:36
javascript:eval(function(p,...
1 2 3 4
# In helper def show_row(object, method) ...
Ruby On Refactor my blog item helper
by Hochwertige Gartenmöbel,
March 12, 2010 14:06
Very nice blog! Bookmarked :)
1 2 3 4
def show_row(model, attribute) "<p><strong>#{model.class.human_attribute_name(attribute)}:</strong> #{model.read_attribute(attribute)}</p>" end ...
1 2 3 4
headerloop = @fragments.enum_for(:each_with_index).collect { |f, i| [b::Uint32be, f.id, b::Uint32be, offset((f.content.size) ,i)]}.flatten #Then calculating the offset outside that block ...
Ruby On Creating a binary file with...
by podcaster,
March 11, 2010 13:18
I managed to fix the offset...
Ruby On Creating a binary file with...
by podcaster,
March 11, 2010 07:38
Hi, thanks so much for the ...
1 2 3 4
gem install http_accept_language
# usage (from http_accept_language's documentation, exemple two is what was sought):
...
Ruby On DataMapper threaded benchmark
by ZeskSkext,
March 09, 2010 13:18
Greetings im a newbie here....
1
attributes.map { |key, value| "#{$1}.#{value}" if key =~ /^svc_(\w{2})_id$/ }.compact
Ruby On Ruby Hash Extraction Using ...
by Martin Plöger,
March 08, 2010 20:53
@mxcl: Seems to be the most...
Ruby On Help generating abbreviatio...
by Fran
,
March 07, 2010 19:46
refactormycode.com, how do ...
1 2 3 4
class String def dedent lines = self.split(/[\x0a\x0d]/); ...
Ruby On ruby dedent whitespace in a...
by dreftymac.myopenid.com,
March 07, 2010 14:36
modified to handle blank lines
Ruby On Create a baseXX string base...
by steenslag,
March 06, 2010 00:05
I just found the radix gem ...
1 2 3 4
File.open 'binary.bin', 'wb' do |file| b = BinData head = b::String, 'Binary file start-point', b::Uint32be, 0, b::Bit16,0, b::Uint24be, @fragments.size ...
Ruby On Creating a binary file with...
by Martin Plöger,
March 05, 2010 20:51
I don't know much about bin...
Ruby On Nested Hash from delimiter-...
by Martin Plöger,
March 05, 2010 14:14
@mxcl, @Devin: I fiddled wi...
