Workaround for File Input on Rails Remote Forms

Workaround for File Input on Rails Remote Forms

Recently, I worked on a project which included a form that was being submitted remotely using jQuery-Rails. The main problem was that the form needed to have a file input on it and jQuery-Rails won’t work if you have one. Now, there are workarounds that work if you need to actually keep the file input. In my case, I was processing the file with JavaScript and then just submitting the parsed data, so the file input wasn’t really needed.

Read more

Using Bootstrap Panels to Organize Data in a Rails App

Using Bootstrap Panels to Organize Data in a Rails App

I’m creating a basic pantry application which will be able to catalog current items in the user’s pantry.  So, one of the pages needed will display different food items and the current quantities in the user’s pantry.  A way to organize this data is to use a Bootstrap Panel to display the current totals and when the selected panel is clicked, individual data values will be displayed.

The data structure consists of Store, Producer, and Unit models, which all just consist of a name.  Next, we have the Food model which has a name, upc, servings, serving_size, and references to a Producer and Unit.  Finally, we have the Stock model which has a price, quantity, discount, bought, and references to Food, Store, and User (for the User I’m just using the basic Devise User model).

Read more