Coder Social home page Coder Social logo

krider2010 / friendly_id Goto Github PK

View Code? Open in Web Editor NEW

This project forked from norman/friendly_id

1.0 3.0 0.0 2.15 MB

FriendlyId is the “Swiss Army bulldozer” of slugging and permalink plugins for ActiveRecord. It allows you to create pretty URL’s and work with human-friendly strings as if they were numeric ids for ActiveRecord models.

Home Page: http://norman.github.com/friendly_id

License: MIT License

friendly_id's Introduction

FriendlyId

FriendlyId is the "Swiss Army bulldozer" of slugging and permalink plugins for Ruby on Rails. It allows you to create pretty URL's and work with human-friendly strings as if they were numeric ids for Active Record models.

Using FriendlyId, it's easy to make your application use URL's like:

http://example.com/states/washington

instead of:

http://example.com/states/4323454

FriendlyId Features

FriendlyId offers many advanced features, including: slug history and versioning, scoped slugs, reserved words, custom slug generators, and excellent Unicode support. For complete information on using FriendlyId, please see the FriendlyId Guide.

FriendlyId is compatible with Active Record 2.3.x and 3.0.

Docs, Info and Support

Rails Quickstart

gem install friendly_id

rails new my_app

cd my_app

# add to Gemfile
gem "friendly_id", "~> 3.1"

rails generate friendly_id
rails generate scaffold user name:string cached_slug:string

rake db:migrate

# edit app/models/user.rb
class User < ActiveRecord::Base
  has_friendly_id :name, :use_slug => true
end

User.create! :name => "Joe Schmoe"

rails server

GET http://0.0.0.0:3000/users/joe-schmoe

Sequel and DataMapper, too

FriendlyId has experimental support for Sequel. Support for Datamapper is in progress. To find out more, check out the Github projects:

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, 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

FriendlyId was created by Norman Clarke, Adrian Mugnolo, and Emilio Tagua.

If you like FriendlyId, please recommend us on Working With Rails:

Thanks!

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

friendly_id's People

Contributors

aduffeck avatar alistairholt avatar dcrec1 avatar empact avatar eric avatar johankok avatar kamal avatar madadam avatar miloops avatar myabc avatar nagybence avatar negonicrac avatar nono avatar norman avatar qhoxie avatar ramon avatar ryanwood avatar seanabrahams avatar shirkevich avatar technicalpickles avatar xymbol avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.