Hello all, I referred the rails guides from documentation section, but I 
cannot solve this problem.

Problem:
1. I have member and receipt model (which should have corresponding members 
and receipts table).
2. Now I created a model called recovery to write some business logic. 
(logic must be in models right?)
3. And I have not created any association between any of the models.

What I want to do:
1. I just want to retrieve all the member_code from members table whose 
'status' is "active" from within *recovery model.*
2. Once all member_code are available I want to compare those member_code 
with the member_code of receipts table. If those member_code exists in 
receipts table, I'll run some business logic only on those members.

*So all I want to do is access the attributes of *members* and *receipts* 
table from recovery model and I have created a button "start recovery 
process" in view.html.erb of recoveries. I would like to execute the 
business logic written inside recovery model once I press this button.*
How can I point the button to the code inside model? Because by default it 
will pointing to actions inside controller right?

Can I do this without creating associations? Or is it compulsory?

Please help me

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/f5da3559-86f9-4887-9fad-fdcff0f19fa9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to