I need to do some code that should be in a controller inside a render partial. How??

I have an app that will be making a customer list to go in a pdf. The pdf part wasn't bad using wicked_pdf. The problem is keeping the controller code where it belongs.

The app has a print method in the controller. It does a render partial to loop through each customer. Once there it needs to make lists of attendance for each of the last 3 years to be part of each customers page. This is different for each customer, so it needs to be re-run each time. This is the part I want to get out of the view. Any way to have another method in the controller to be run for each customer?

Sounds like the Customer model might make a good place for the method to live. In the view you can call @customer.go_get_my_data ...

Thanks. That should work fine.. Is there anything special to do to make the method seen in the view?

Bob

As long as it's a public method, it will be accessible wherever you have any instance of the class.

as notes*

at ruby, u va access to all methods of class, wherever u have any instance of this class =)

=)

Best Regards, Dieinzige