{<img src="https://codeclimate.com/badge.png" />}[https://codeclimate.com/github/mattways/rails-slugs]

= Rails Slugs

Inspired in friendly_id but more minimalistic.

= Install

Put this line in your Gemfile:
  gem 'rails-slugs'
  
Then bundle:
  $ bundle
  
= Usage

Add the column in your migration:
  t.string :slug
  
(If you are using rails-i18n-record you need to place the column in the translation table, this has been done this way because it's easier to maintain and your queries will be faster avoiding extra joins)

Update your db:
  rake db:migrate

Call the slug method in your model:

If you want to use the value of one field:
  slug :prop
  
To concatenate the value of multiple fields:
  slug :prop1, :prop2, :prop3
  
Or if you need a very custom slug:
  slug proc { |record| "#{record.prop}-custom" }

{<img src="https://codeclimate.com/badge.png" />}[https://codeclimate.com/github/mattways/rails-slugs] {<img src="https://secure.travis-ci.org/mattways/rails-slugs.png?branch=master" alt="Build Status" />}[https://travis-ci.org/mattways/rails-slugs]

= Rails Slugs

Inspired in friendly_id but more minimalistic.

= Install

Put this line in your Gemfile:
  gem 'rails-slugs'
  
Then bundle:
  $ bundle
  
= Usage

Add the column in your migration:
  t.string :slug
  
(If you are using rails-i18n-record you need to place the column in the translation table, this has been done this way because it's easier to maintain and your queries will be faster avoiding extra joins)

Update your db:
  rake db:migrate

Call the slug method in your model:

If you want to use the value of one field:
  slug :prop
  
To concatenate the value of multiple fields:
  slug :prop1, :prop2, :prop3
  
Or if you need a very custom slug:
  slug proc { |record| "#{record.prop}-custom" }

Add travis ci status image
Add travis ci status image
