Ruby on Rails Monday, January 31, 2011



On Mon, Jan 31, 2011 at 12:03 PM, PalaniKannan K <kpalanikannan@gmail.com> wrote:
Hi david,

thanks for your suggestion.

I tried 'case' statement before. But, I am using 'if' statements in the array loops of @descriptions and description.table2. @descriptions is an array generated in table 1's controller. If I wish to 'use' either table 1 or table 2 models... I am getting into problem to merge this two array loops. how i can use @desctipion (array generated in table1 controller) in the model of table 2? Kindly help this regard.

I would think also you might be able to use includes or joins in your activerecord call, and/or a where condition to 'merge' your results. Personally I would write out in pseudo-code what trying to do and then get as close to the db first (using activerecord in this case).
 

--
with regards,

palani kannan

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment