norman/friendly_id — Issue #237: slugs history and routes
Author: gasova
Created: 2012-02-23 18:12:52+00:00
State: open

can you please add the ability to define our own history slug table name instead of specifying a non standard table name :
in the old version the history table name was called slugs so I used it on the routes.rb to find the required controller to fire up because I want links without controller names... I used following code in my routes:

match '/:id', :to => proc { |env|
id = env["action_dispatch.request.path_parameters"][:id]
id = Slug.where(:name => id).first.id
model = Slug.find(id).sluggable_type
controller = [model.pluralize.camelize,"Controller"].join.constantize
controller.action("show").call(env)
}, :as => :slugable

but after update and because of the table name you fixed in your class I cannot route...

class Slug < ActiveRecord::Base
self.table_name = "friendly_id_slugs"
belongs_to :sluggable, :polymorphic => true
end

It would be nice If you let us set this table name in the general config process...

Regards.