On Wed, Sep 5, 2012 at 1:14 PM, Sa S. <[email protected]> wrote:

> Sorry, I should clarify. In my Model_2 view, I'm trying to simply have a
> table that iterates through all the model_1's and calculates that method
> above using the model_1's attribute that I need

But you're not showing us a view, you're showing us a model.

Do you really want `some_method` to return one value or an array
of values?

If you only want one value, why don't you pass the Model_1 instance
(or the attribute) you're interested in to the Model_2 instance?

def some_method(model_1_attribute)
   attr_a * model_1_attribute
end

-- 
Hassan Schroeder ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to