Agile Web Development

Build it. Launch it. Love it.

Permalink Fu

This is a simple plugin extracted from Mephisto for creating permalinks from attributes.

  class Article < ActiveRecord::Base
    has_permalink :title
  end

This will escape the title, making it fit to use in a URL in the after_validation callback.

Use PermalinkFu.escape to escape a string manually if you like.

Vitals

Repository http://svn.techno-weenie.net/projects/plugins/permalink_fu/
License Rails' (MIT)
Tags Tag_red permalink slug
Rating (20 votes)
Owner Rick Olson
Created 19 February 2007

Comments

  • Avatar
    James Herdman
    24 April 2007

    This is a very concise plugin with little-to-no documentation. It'll get the job done, but you're flying blind for the most part.

  • Avatar
    Guillaume
    20 August 2008

    I wasn't able to update all the existing objects I had, after adding the plugin. I had to change a line in permalink_fu.rb in order to fix an invalid SQL condition that was sent to the DB. Something like : "WHERE (permalink='', 'permalink-title-value' AND ID!=1)

    Line 74

    #base    = send(&quot;#{self.class.permalink_field}=&quot;, send(self.class.permalink_field)[0..limit - 1])
    base    = send(self.class.permalink_field)[0..limit - 1]
    

    I also used the howto tutorial for this plugin written by Eadz here : http://www.seoonrails.com/even-better-looking-urls-with-permalink_fu

  • Avatar
    23 January 2009

    ConversionBay provides world-class end-to-end BPO solutions using an optimum mix of onsite, offsite, and offshore services to deliver the best value to our clients.

  • Avatar
    6 March 2009

    Most of the plugins including this one assumes that everyone knows everything. So they contain very little or no information. For example, permalink_fu does not have instructions on how to use it for an existing project (where records already exist). very disappointing.

Add a comment