Posted by Andrew Cetinick on June 13th, 2008
When I started using Rails I was pretty confused with the differences in different ways you can setup relationship in your model. I will run you through the best way to implement a many-to-many relationship between your Rails models.
Related: Ruby on Rails one-to-many Tutorial
Related: Ruby on Rails one-to-one Tutorial
Read the rest of this entry »
Posted by Andrew Cetinick on June 4th, 2008
For a simple way to add attachments to your models I recommend that you use attachment_fu. In this tutorial I’m going to walk you through how to attach images to a User model, so a User can have a gallery of images. The attachment_fu plugin is by far the best I have seen for adding attachments such as PDF, DOC, ZIP files and more importantly images. attachment_fu supports mutliple storage types for your attachments (database, filesystem and amazon s3). It automatically creates thumbnails for your images using different processors (ImageScience, RMagick and MiniMagick). Supports vaildation, such as minimum size and the content type.
Read the rest of this entry »
Posted by Andrew Cetinick on May 15th, 2008
To implement authentication for your Rails application I recommend using the restful_authentication plugin created by technoweenie. There are quite a few plugins at his Git repository , so I recommend that you take a look.
Read the rest of this entry »
Posted by Andrew Cetinick on May 13th, 2008
Lately I have been playing around with the acts_as_ferret plugin which makes it dead simple to implement full text search in your models for Ruby on Rails. The plugin is designed for the Ferret gem (a full featured search engine based on Apache Lucene). In this article I will guide you through the steps needed to implement searching for your models and talk about some of the problems I faced on the way.
Related: Ajax search in Rails
Read the rest of this entry »
Recent Comments