slugs history and routes #237

Closed
gasova opened this Issue Feb 23, 2012 · 5 comments

Projects

None yet

3 participants

@gasova
gasova commented Feb 23, 2012

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.

@norman
Owner
norman commented Feb 23, 2012

Sure, that sounds reasonable.

@gasova
gasova commented Feb 23, 2012

Great :)

Thanks a lot.

@parndt
Collaborator
parndt commented Mar 3, 2013

Was this attempted by anyone?

@parndt
Collaborator
parndt commented Apr 16, 2013

@norman do you plan to still support this? How would we implement it?

@norman
Owner
norman commented Apr 16, 2013

This issue didn't matter enough to me personally to take action on it, though I'm not in principle opposed to it. In the interest of taking some concrete action though, let's close this. I'll be happy to accept a pull request that fixes this if somebody feels motivated enough to send one.

@norman norman closed this Apr 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment