1 2 3 4
class Chat < ActiveRecord::Base KINDS = [[:office.l('Oficina'),0],['Personal',1]] ...
1 2 3
<!-- THE XML IM TRYING TO PARSE --> ...
Ruby Trying to parse XML and pas...
I am completely new to ruby...
1 2 3 4
# OPTIMIZE: I think we can do a LOT for optimize this. def create added_counter = 0 ...
Ruby Importing large collection ...
This scripts get textarea w...
1 2 3
ActionController::Routing::Routes.draw do |map| eval(File.open(File.dirname(__FILE__) + '/../path/to/another/routes/file.rb', 'r').read) end
Ruby Adding routes in an externa...
I'm trying to retain the ra...
1 2 3 4
# in lib/product_scraper/base.rb class ProductScraper::Base def product_pages ...
Ruby OO Ruby help, por favor
This is really my first att...
1 2 3 4
<table class="charge"> <tr> <td colspan="100%" class="mainHeader"><%=@label.label%></td> ...
Ruby Iterating through a nested ...
by mwilliams,
January 31, 2008 18:21,
2 refactorings, tagged with rails, view, table, hash, nested hash, iterator, iterate, ruby, Ruby on Rails
Good afternoon. I have a n...
1 2 3
@a_to_z = Service.find(:all,:select=>'SUBSTR(name,1,1) AS letter',:group=>'SUBSTR(name,1,1)',:order=>'name').collect { |d| d.letter } ...
Ruby A to Z only linking to lett...
by aubergene,
January 13, 2008 21:10,
1 refactoring, tagged with Ruby on Rails, rails, alphabet, a to z
I wanted A to Z anchor link...
1 2 3 4
def planned_percent_complete if self.planned_complete_in_dollars != nil (( self.planned_complete_in_dollars.to_f / self.task.budget.to_f ) * 100).round(2) ...
Ruby Same methods, different Act...
I know there has to be a "r...
1 2 3 4
def self.find_matches(params) matches = self.find(:all) ...
Ruby Filtering Method Needs to b...
by bradly.myopenid.com,
January 04, 2008 16:38,
No refactoring, tagged with ruby, rails, filtering, wet
I know it looks long, but i...
1 2 3
def filename self.uri.split('/').last ...
C# Get the Filename segment o...
by jwmittag,
January 01, 2008 15:04,
10 refactorings, tagged with ruby, rails, Ruby on Rails, RoR, C#, CSharp, C-Sharp, .net, DotNET, asp.net, Scott Porad, Comparison
On his Blog "Progress vs. P...
1 2 3 4
before: def list_for_blogentries(user) ...
Ruby Refactor my blog item helper
I have a helper to show all...
1 2 3 4
def favorite message = Message.find params[:id] ...
Ruby Refactor my favorite action.
My code looks lousy, please...
1 2 3 4
- form_for :user, :url => users_path do |f| %ul.register %li ...
Ruby Help Refactor this into Rai...
I have no idea how to creat...
1 2 3 4
def which_class? if self.language == "C/C++" self.language = "sh_cpp" ...
Ruby class picker
language is a column in a c...
1 2 3 4
def zipcode=(new_zipcode) if new_zipcode != self.zipcode write_attribute(zipcode, new_zipcode) #problem here ...
Ruby overwriting an activerecord...
I simply want to overwrite ...
1 2 3 4
# Sample Output: # # <tr> ...
Ruby Iterated printing in the he...
Here is a function I have b...
1 2 3 4
Element.addMethods({
pngHack: function(el){
var el = $(el);
...
JavaScript pngHack
by getopenid.com/deleteme,
November 15, 2007 03:40,
1 refactoring, tagged with rails, png, image, img, prototype, hack
Makes 32 bit PNG's transpar...
1
<%= (@post.category ? @post.category.name : '') + ' ' + link_to(@post.title, post_path(@post)) %>
Ruby Handling nil object
@post.category can be nil, ...
1 2 3
class PostsController < ResourceController::Base ...
Ruby resource_controller: Redesi...
Backstory on my blog: http:...
1 2 3 4
module ModelHelpers def self.included(base) ...
Ruby textilize model helper
OK, so I just realized ther...
1 2 3 4
namespace :migrations do desc 'reverts, renames and re-executes uncommitted migrations that conflict with already committed migrations' ...
Ruby Rails migration conflict re...
Explained here: http://www....
So far this works a treat, ...