Displaying 6 results from an estimated 6 matches for "black2".
Did you mean:
black
2009 Sep 27
3
Newbie Trouble with RubyOnRails Bible
Hello all,
I am new to RoR and am working my way through Timothy Fisher''s Ruby On Rails
Bible. I''m stuck on page 81. I have followed the steps leading to this page,
i.e.
cd rails_projects
rails contactlist
<creates all the directories>
ruby script/server webrick
<shows the Welcome Aboard page>
open a cmd window and run mysql: create database contactlist_development;
2009 Sep 23
5
Overriding AR read/write_attribute - Overridden write_attribute Is Never Called
Could someone explain this?
#config/initializers/ar_attributes.rb
module ActiveRecord
module AttributeMethods
alias_method :ar_read_attribute, :read_attribute
def read_attribute(attr_name)
p "read_override"
ar_read_attribute(attr_name)
end
alias_method :ar_write_attribute, :write_attribute
def write_attribute(attr_name, value)
2009 Aug 28
2
Association extension method
In my application a user working at a dropzone can manipulate
transactions against customer accounts. Here''s my models:
class Transaction < ActiveRecord::Base
belongs_to :account
end
class Account < ActiveRecord::Base
belongs_to :dropzone
has_many :transactions
end
class Dropzone < ActiveRecord::Base
has_many :transactions, :through => :accounts do
def
2009 Sep 24
2
Calling ActionView from uninheriting class
Hi Gurus, I have a class, specified in models cart.rb, which doesn''t
inherit from anything--it''s just a container
class Cart
...
I just discovered I can''t call number_to_currency in that class. Any
idea how to "include" it in my code? I tried
ActionView.number_to_currency without luck. I could kill a few lines
of non-DRY regexp code in cart.rb if I could
2009 Oct 04
1
circular relationship - habtm
So I have 2 models: Picture and Comment.
Pictures have many Comments, but I''d like for users to be able to post
Pictures in Comments, so Comments will have one Picture (possibly).
This creates a kind of circular relationship it looks like, and the
only way I could think of to implement this is with
has_and_belongs_to_many. Am I right, or is there a better way to do
this?
2009 Jul 16
9
Please help me understand how arrays are translated in rails
I''ve spent hours researching the subject and have tried many test
sequences in IRB, and rails console but I''m just having trouble making
headway into what is probably a very easy subject.
I understand arrays with at least 4 other languages but with Ruby I
haven''t found a mental connection with how I can assign variables to
arrays..
Take for example:
def