I'm developing a small data-crunching / visualization app in Sinatra, and am split between two options.
The functionality is that you:
- Upload a file to the app.
- See a nice visualization of its contents.
- Maybe start over with a new file.
So my choices are:
- Letting both views (upload and results) be managed by the same template, thus creating a single-page app.
- Splitting uploads and the visualization between two pages. You upload a file to '/', then are redirected to that file's URL which displays the results.
Which one is better? The advantage of the first is that I can manage it all within the same page, by passing some local vars between the two views.
On the other hand, the second seems like the more RESTful option - because each uploaded file gets its own URL and can be treated as a resource (more fine-grained control).