I have been thinking about the best way to render forms in a single page web application. Sure you could just use template literals to bang out whatever inputs you need but there would always be a chance you get the naming scheme wrong and if there was a change in the object schema you would have to dig into the code and make the changes at a pretty low level. So I was wondering if there is a tool in js that can relate an object to a form similar to what active record does with form_for.
Park Explorer is a ruby on rails web application that lets users share their park photos and experiences with the community. Users score their photo in different categories. The scores can then be used a diagnostic tool and or public metric that helps inform principals about the health / state of the park.
I made the mistake of making file upload one of the main features of my rails project. It was not terribly difficult to get the backend to work using the carrierwave gem but when it came time to create the same functionality with a single page web application I stumbled around quite a bit. I did not see a clear way to configure the XMLHttpRequest() to handle multipart/form-data. After quite a bit of google bushwacking I found the answer: The HTML5 FormData Object.
This application is very similar to Strava where a cyclist sets up an account logs her rides and then can get a dashboard view of bikes, rides and total miles. The public section is a simple leader board listing all of the riders and the number of miles ridden. The user has the typical CRUD functions for bikes and rides and these all require user login.
My gem is called Race Finder. As the name suggests it scrapes the racecenter web site for a list of current races, presents a list of these races and gives the user the opportunity to get more information about a particular race. Version 2.0 will give the user the chance to generate the initial race list based on type and location. This is what the interface looks like: