What would be the best way to incorporate a loan amortization schedule in my rails app? Is it possible? Is ruby on rails even a good way to implement something like that? I have built them in excel a few times before, but just can't picture how to do it in rails.
1 Answers
This all depends on the actions your users will need to perform on/with the schedule.
If your goal is simply displaying the schedule, there's no need to persist the entire array of dates/payments/etc. Simply store a start/end date, payment interval, loan amount, interest rate and the payment amount. It isn't heavy work to construct the actual schedule given this information.
If your users should be able to annotate specific items within the schedule, then consider which properties of each item would make good unique identifiers (hint: loan + item date). From there, your models should flesh out easily:
class ScheduleItem
{
date dueDate;
float paymentAmount;
string annotations;
bool isPaid;
...
}
class Schedule
{
int loanId;
date startDate;
date endDate;
...
}
If you do decide you need models (to persist or just to generate views) representing the schedule start with the simplest implementation possible and expand from there. You're most likely having trouble getting started because you're trying to incorporate every variable from the start. Keep it simple. Get things rolling.

- 3,513
- 28
- 52
-
Awesome response, thanks. To begin with, I would like to just input basic loan information such as amounts, rates, terms, loan name. The only manipulation on the data that I would like to do would be to add extra payments at any point during the loan. I am really new to all this, but love learning through new projects. Is it too much to ask how to get started? In other words, what the basic set up should look like with these items and how to actually display the information in a view? – FattRyan Apr 12 '11 at 16:31
-
1StackOverflow isn't the right place to look for subjective questions like these. This site is intended as a place for you to come back with specific questions once you've started your implementation. How you display an amortization schedule is a very subjective issue. The FAQ can help explain what types of questions work best on this site: http://stackoverflow.com/faq – Jeff Swensen Apr 12 '11 at 16:35