Ruby Contoller refactoring
by DG, July 30, 2008 09:35, 2 refactorings
123
def invite_friends...
123
#include math.h>#include stdio.h>...
Solutions welcome in any la...
123
def granny_says(str) ...
I've been working on this p...
1234
if @foo.update_attributes(params[:foo]) and @foo.bar.update_attributes(params[:bar]) redirect_to foo_url(@parent) else...
What's the best way to save...
1234
/** * http://www.openjs.com/scripts/events/keyboard_shortcuts/ * Version : 2.01.B...
I found below code very use...
1234
module ThinkingSphinx class Search class self...
Recently, I need to extend ...
123
+----------+-------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |...
What I am trying to do is a...
1234
def tab(name, options = {}) if name == controller.controller_name.humanize || root_of_path.humanize == name content_tag :li, link_to("#{name}", options), :class => "active"...
This is for a tabbed naviga...
1234
require 'win32ole'autoit = WIN32OLE.new('AutoItX3.Control')...
This is for the online poke...
1234
this.getHttpRequest(identifier).onreadystatechange = function() { try { ajaxChat.handleResponse(identifier);...
This code crashes Firefox 3...
1234
class User ActiveRecord::Base has_many :orders...
I think there's a way to do...
1234
%w(er_quantitative pr_quantitative p53_quantitative fish_quantitative oncotype_quantitative).each do |field| class_eval def #{field}_s...
er_quantitative, pr_quantit...
1
v = a[:k][0] || 1
The problem with this code ...
1234
puts "Yes means No and No means Yes. Delete all files [Y]?"yes, no = "no", "yes"...
Optimize for poeticness.
1234
module DashboardHelper def activity_message_for(object) case object.class.name...
This works but it's kind of...
1234
class DB {...
For the most part, this cla...
1234
#!/usr/bin/perluse strict;use warnings;...
Converting the return from ...
1234
# This method searches a source by the http, the www and the trailing / to a url def self.find_by_url(url) Source.find :first, :conditions => [ " url = ? OR url = ? OR url = ? OR url = ? ", url, url.gsub("http://", "http://www"), url + "/", url.gsub("http://", "http://www")+"/"] ...
Hi!
I've a got a website A...
1234
module Enumerable def cluster sort.inject([[]]) do |out, n|...
%w[app noot app mies zoo m...
1234
def link_to_param(text, param, values) @qs ||= {} if @qs.blank?...
In a Rails application, I h...
1234
def self.paged_search(query, from, category, locality, page, per_page = 10) query_str = [] query_prms = []...
This code has multiple flaw...
1234
class AccountsController ApplicationController layout 'application'...
Mostly straight from a tuto...
123
-module(endsrename)....
Nintendo DS roms and saves ...
123
class Findplugin...
Hello,
- I am working on a...
1234
# A set of monkey patches for the ruby programmer who isn't yet satisified with the core libraryclass Object # useful for reflection...
I find ruby's core library ...
In following Home controlle...