Skip to content

malagant/friendly_id_mongoid

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 3 commits ahead, 28 commits behind myabc:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

FriendlyId Mongoid Adapter

This is an pre-release (beta) adapter for FriendlyId using Mongoid.

FriendlyId Features

It currently supports all of FriendlyId's features except:

  • Rails Generator
  • Support for multiple finders

Currently, only finds using get is supported.

@post = Post.get("this-is-a-title")
@post.friendly_id # this-is-a-title

Compatibility

The FriendlyId Mongoid Adapter keeps in lock-step with major and minor versions of the FriendlyId gem, i.e. friendly_id_datamapper 3.1.x is compatible with friendly_id 3.1.x series. Patch and build versions are not kept in lock-step.

Usage

gem install friendly_id friendly_id_datamapper

require "friendly_id"
require "friendly_id/mongoid"

class Post
  include Mongoid::Document

  field :id,    Serial
  field :title, String

  has_friendly_id :title, :use_slug => true
end

For more information on the available features, please see the FriendlyId Guide.

Bugs

Please report them on the Github issue tracker for this project.

If you have a bug to report, please include the following information:

  • Version information for FriendlyId, friendly_id_mongoid, Rails and Ruby.
  • Stack trace and error message.
  • Any snippets of relevant model, view or controller code that shows how your are using FriendlyId.

If you are able to, it helps even more if you can fork FriendlyId on Github, and add a test that reproduces the error you are experiencing.

Credits

Copyright (c) 2010, released under the MIT license.

About

An adapter which allows you to use FriendlyId with DataMapper

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%