This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Post < ActiveRecord::Base | |
has_many :comments | |
def comments=(attrs_array) | |
attrs_array.each do |attrs| | |
comments.create(attrs) | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render :template => "weblog/show", :locals => {:customer => Customer.new} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What's new in Rails 2.0.4 | |
------------------------- | |
Action Mailer | |
* Less verbose mail logging: just recipients for :info log level; the whole email for :debug only. #8000 [iaddict, Tarmo Tänav] | |
* Updated TMail to version 1.2.1 [raasdnil] | |
* Fixed that you don't have to call super in ActionMailer::TestCase#setup #10406 [jamesgolick] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Action Pack | |
* All 2xx requests are considered successful [Josh Peek] | |
* Deprecate the limited follow_redirect in functional tests. If you wish to follow redirects, use integration tests. [Michael Koziarski] | |
* Fixed that AssetTagHelper#compute_public_path shouldn't cache the asset_host along with the source or per-request proc's won't run [DHH] | |
* Deprecate define_javascript_functions, javascript_include_tag and friends are much better [Michael Koziarski] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: "viu", | |
icon: "http://www.viuisso.com.br/favicon.ico", | |
author: {name: "Mentor Muniz", email: "[email protected]"}, | |
description: "Viu Isso? Search", | |
homepage: "http://www.viuisso.com.br/", | |
takes: {"query": noun_arb_text}, | |
execute: function (q) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html | |
Olá, Eu sou Chris Wanstrath. | |
Quando Jeremy me chamou para falar, eu disse sim. Maldição, eu disse sim. | |
Imediatamente. Mas, depois que parei para pensar, Espera, por quê? Por que eu? | |
O que eu vou dizer de interessante? Alguma coisa sobre Ruby, talvez. Talvez, | |
sobre o futuro dele. Ou o futuro de algo, pelo menos. Isto soa como um | |
keynote-y. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NilClass | |
def to_s | |
"n/a" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def silent(command) | |
system "#{command} &> /dev/null" | |
end | |
silent "git add ." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object | |
def try(method_id, *args, &block) | |
respond_to?(method_id) ? send(method_id, *args, &block) : nil | |
end | |
end | |
require 'rubygems' | |
require 'spec' | |
describe Object, "#try" do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$.fn.defaultValueActsAsHint = function() { | |
return this.each(function() { | |
$(this).attr('_default', $(this).attr('value')) | |
$(this).addClass('hint'); | |
$(this).bind('focus', function(event) { | |
if ($(this).attr('_default') == $(this).attr('value')) | |
$(this).removeClass('hint').attr('value', ''); | |
}); |
OlderNewer