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:
Mar 17

Date published: 3-17-2014

Rails version: 4.0.0

Staging server

When creating and deploying web apps with Rails, it’s a good idea to have a staging server that is identical to the production server where you can test out changes before making them live. That way you can test out the application in an environment that will be like what your users will be using but without making changes to the live application or its database. I’ll be setting up a staging server on Heroku to show the changes you’ll need to make to your Rails project to get it up and working. Continue reading »

Tagged with:
Mar 03

Date published: 3-3-2014

Rails version: 4.0.0

Pagination

It’s common on web sites to have large numbers of records in the database. It’s not always useful to see all the items in the database at the same time as it could take a long time to load and involve a lot of scrolling to find the information we want. This is where pagination can be used as a helpful way to divide a set of results into chunks that are easier to use. A good example of pagination that is familiar to any web user is the set of links at the bottom of the page of search engines like Google. It has links to go to the next and previous pages and information about how many pages there are to look through. Continue reading »

Tagged with:
preload preload preload