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

Adding SpreeFancy to Your Store

Adding SpreeFancy to Your Store

As I went over in my last blog article, a simple addition you can make to your spree store is adding the SpreeFancy gem, adding an attractive theme to the base store. SpreeFancy is easy to install. Just add this to your Gemfile:

gem 'spree_fancy', :github => 'spree/spree_fancy', :branch => '2-1-stable'

And run bundle after that. Note: I am running a Spree 2.1 store, so I am using the 2-1-stable branch. If you are using another version of Spree, be sure to have the Gemfile pointing to the correct branch of SpreeFancy.

Read more

Customizing a Default Spree Store, Time Estimates

Customizing a Default Spree Store, Time Estimates

Spree is a great Ruby on Rails e-commerce platform, allowing developers and clients to quickly set up an online store-front. A completely functional store can be built in a relatively short amount of time. Additional customization can commence from there.

Spree comes with a front end theme already installed. This allows a developer to quickly provide a working store with a usable front end. A default Spree store looks like this:

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

Building a Schedule with D3

Building a Schedule with D3

The One Acre Cafe, a non-profit community café, recently opened in Johnson City. But due to budget constraints, they’re without software to manage their volunteer staffing.

I thought I would do a simple rails app (live) to try and address this problem. For rendering the calendar, I decided to do it client-side usingD3 . My initial version was in SVG, based on the Calendar View example. The SVG layout relied on static block sizes, so I reimplemented it in HTML.

Read more