1
2
3
4
class Chat < ActiveRecord::Base
  
  KINDS = [[:office.l('Oficina'),0],['Personal',1]]
...

Ruby Multilingual Model Options

by pimp, June 09, 2008 10:21, 2 refactorings, tagged with rails, models, multilingual

So far this works a treat, ...

67c02d91e6570d0a0f6e67f96dd7ce28 Talk
1
2
3
<!-- THE XML IM TRYING TO PARSE -->
...

Ruby Trying to parse XML and pas...

by Jason, May 30, 2008 20:09, 4 refactorings, tagged with ruby, rails, parse, xml, hpricot

I am completely new to ruby...

A4e2fea57f511d697f1de55198996f23 Talk
1
2
3
4
  # OPTIMIZE: I think we can do a LOT for optimize this.
  def create
    added_counter = 0
...

Ruby Importing large collection ...

by mister, March 22, 2008 19:16, 2 refactorings, tagged with ruby, rails

This scripts get textarea w...

Avatar Talk
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...

by jseifer, March 07, 2008 22:40, 2 refactorings, tagged with rails

I'm trying to retain the ra...

1543059f424f9fe5b7654413e6c8dc22 Talk
1
2
3
4
# in lib/product_scraper/base.rb
class ProductScraper::Base
  def product_pages
...

Ruby OO Ruby help, por favor

by misfo.myopenid.com, February 01, 2008 16:19, 3 refactorings, tagged with oo, oop, rails, lib

This is really my first att...

Cee19a4eb998343e677f7f1cfd4de5bb Talk
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...

4236ea6b84f4899b469e8edff4bf6d22 Talk
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...

B78453e586d294bcd297f8ec44ec3458 Talk
1
2
3
4
<% myid = self.current_user.id %>


...

Ruby Rails has_many count

by nootopian, January 10, 2008 21:23, 11 refactorings, tagged with rails, has_many

Hi,

I have a users users...

62c433a96de9da99d09afedcded5de76 Talk
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...

by Chris W., January 08, 2008 18:31, 6 refactorings, tagged with ruby, rails, activerecord, dry

I know there has to be a "r...

Avatar Talk
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...

0914e5093f1af95df0ab2478818856d8 Talk
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...

4bae3f603d397647c273dfa49ef8050c Talk
1
2
3
4
before:

def list_for_blogentries(user)
...

Ruby Refactor my blog item helper

by winson, December 19, 2007 07:32, 7 refactorings, tagged with rails

I have a helper to show all...

0f9b6b2dd5ecff193f6dd78502ce1a13 Talk
1
2
3
4
  def favorite
    message = Message.find params[:id]
        
...

Ruby Refactor my favorite action.

by winson, December 12, 2007 06:20, 14 refactorings, tagged with rails

My code looks lousy, please...

0f9b6b2dd5ecff193f6dd78502ce1a13 Talk
1
2
3
4
- form_for :user, :url => users_path do |f|
  %ul.register
    %li
...

Ruby Help Refactor this into Rai...

by Daniel Fischer, December 11, 2007 03:39, 6 refactorings, tagged with rails

I have no idea how to creat...

73af4fece11ee3767dc13e89cdc08500 Talk
1
2
3
4
def which_class?
  if self.language == "C/C++"
     self.language = "sh_cpp"
...

Ruby class picker

by Garrett, December 10, 2007 00:04, 8 refactorings, tagged with ruby, rails, activerecord, model

language is a column in a c...

E9674d02c33d1d711a462026f40bbaf4 Talk
1
2
3
4
  def zipcode=(new_zipcode)
    if new_zipcode != self.zipcode
      write_attribute(zipcode, new_zipcode) #problem here
...

Ruby overwriting an activerecord...

by Alain, November 28, 2007 03:13, 1 refactoring, tagged with rails

I simply want to overwrite ...

Ca35abdcc0ebbaada3c935c2746ed5ea Talk
1
2
3
4
 # Sample Output:
 #
 #  <tr>
...

Ruby Iterated printing in the he...

by XGamerX, November 18, 2007 03:52, 2 refactorings, tagged with rails, helper, radio button

Here is a function I have b...

55d6457963d5be7ad341343105ddc8a3 Talk
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...

Db11d496fa96adac53b422feb6efd493 Talk
1
<%= (@post.category ? @post.category.name : '') + ' ' + link_to(@post.title, post_path(@post)) %>

Ruby Handling nil object

by macournoyer, November 14, 2007 02:07, 13 refactorings, tagged with rails, html

@post.category can be nil, ...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
1
2
3
class PostsController < ResourceController::Base
...

Ruby resource_controller: Redesi...

by jamesgolick, November 05, 2007 20:27, 4 refactorings, tagged with rails, resource, restful

Backstory on my blog: http:...

F6eddf2f983d23c2d031e407852625e9 Talk
1
2
3
4
module ModelHelpers

  def self.included(base)
...

Ruby textilize model helper

by rpheath, November 02, 2007 03:01, 2 refactorings, tagged with ruby, textile, rails, filter

OK, so I just realized ther...

E635ccff7389d9070f5e7e9fe8b36beb Talk
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...

by danielharan, October 26, 2007 18:25, 1 refactoring, tagged with rails

Explained here: http://www....

880cbab435f00197613c9cc2065b4f5a Talk