Mar 31

Date published: 3-31-2014

Rails version: 4.0.0

Counting with Javascript

It’s common in Rails apps that take input to use text areas to enter large blocks of text. It’s also common to have a limit on the amount of text that can be entered to ensure the database doesn’t get filled with pointlessly long posts or comments. It’s easy to put a validation in a model to limit the amount of text that can be entered, but it’s nice to give feedback in the view to show how much of the limit the user has already used. Continue reading »

Tagged with:
Oct 28

Date published: 10-28-2013

Rails version: 4.0.0

Sorting lists

One thing that comes up fairly often on web sites is the need to sort lists of items. A good example of this would be a wishlist like on the Steam web site. It lets you add items to your wishlist and then sort them so they will be shown in whatever order you prefer. Rails offers a very easy way to create sortable lists, and I’ll show you how to set it up for a basic todo list.

Steam wishlist

Steam wishlist

Continue reading »

Tagged with:
preload preload preload