RE: Rails Digest, Vol 21, Issue 160


#1

On the account web page, I have a button_to link to an action
called ‘add_invoice’. I added a def for ‘add_invoice’ in
account.rb, but I can’t figure out what to put inside the
def. Is another controller needed (invoice.rb)? Can I do it
from within account.rb?

I’m trying to wrap my head around this concept - can anyone help?

Imo, the decision is to be made on the requirements. If this is the only
place that you need to add invoices from, then just use this controller
and do a create method on the invoice model.

Regards,
Bharat