1 2 3
class Account < ActiveRecord::Base has_many :websites ...
Ruby On Rails - Multiple instances ...
by Fabien Jakimowicz,
August 03, 2008 12:48
You should move a lot of lo...
1 2 3
class MyaccountController < ApplicationController before_filter :load_users, :only => [ 'account_details', 'show_email_box', 'show_mobile_box' ] ...
Ruby On How to make instance variab...
by Fabien Jakimowicz,
July 31, 2008 13:33
You can use a before filter...
1 2 3 4
def update_foo_and_bar # You can also use @foo.class.transaction and @foo.bar.class.transaction if you have multiple database at the same time ActiveRecord::Base.transaction {@foo.update_attributes!(params[:foo]) and @foo.bar.update_attributes!(params[:bar])} ...
Ruby On Saving multiple models in o...
by Fabien Jakimowicz,
July 29, 2008 22:21
there is a lot of way to cl...
1 2 3 4
xml = REXML::Document.new(data) artists = xml.elements.to_a('//artist')[0..limit].collect do |artist| ...
Ruby On cleaner way to limit result...
by Fabien Jakimowicz,
July 14, 2008 23:38
i'm not familiar with REXML...
Ruby On collecting attributes from ...
by Fabien Jakimowicz,
June 17, 2008 15:32
I thought the same about ht...
