Auran Buckles

Creating Dynamic Nested Forms in Rails with jQuery - Part II

Gems like cocoon and nested_form make nested forms an easy cake in Rails, but not everyone prefers to pile on gems in their projects. Whether it’s because of dependencies issues down the line, or whether it’s the lack of control, you might want to build nested forms the old-fashion vanilla way. For me, it was because the nested_form gem just wasn’t producing the exact outcome I was looking for. Creating user-friendly, dynamic forms can get tricky, especially when relationships are complex. But even if you end up using gems, hopefully this article still sheds some light on how they operate behind the scenes.

Creating Dynamic Nested Forms in Rails with jQuery - Part I

I’m currently working on a project for nonprofits to create event pages, which allows users to register for, volunteer at, or sponsor these events. To allow nonprofits to create sponsorship levels for sponsors to choose from when creating an event, I’ve had to add nested fields via multiple has_many and has_many :through relationships. For the first layer of the relationship, I used the nested_form gem, with some jQuery sprinkled on to enhance UX, which is the focus of this article. Because utilizing the gem in implementing more complex relationships wasn’t very practical, the next article will be demonstrating how this can be done through pure jQuery.

Injecting Metadata Into Objects in Stripe With Webhooks

Metadata contains additional, neatly structured information about an object, mostly in the form of key-value pairs. In Stripe, a wide range of objects such as Account, Charge, Customer, Refund, Subscription, and Transfer all allow for a metadata parameter, which greatly enhances the developer experience in interacting with the Stripe API. In this app I’m working on, donors can sign up to donate monthly to nonprofits via Stripe. With the help of webhooks, we’ll take a look at how we can get notified when a recurring payment was successfully processed, then update that payment’s metadata parameter with the donor’s first name and last name.

Using the Google Analytics API Ruby Gem in Rails

Google has some of the most useful APIs for apps and developers to gather information from Google or data from its users. The two most popular are Google Maps and Google Talk. The Google Analytics APIs are also valuable resources for analysts and website owners to reach the right audience. Google Analytics collects user-interaction data through an embedded script on the website, which then allows developers to manage how the data is processed. The APIs then provide access and reports data such as the average page load time or the number of daily transactions on a given website.

Authenticating Google Users with Devise and OmniAuth in Rails

While building authentication processes from the ground up can prevent incompatibilities that can be hard to debug, sometimes we prefer the convinience of relying on gems built by others. Devise and OmniAuth are classic gems that authenticate through internal databases and external providers. These libraries, being open sourced, have withstood lots of trials and errors and are very powerful tools if you get it right.