revolutionhealth / acts_as_seo_friendly

Create SEO friendly names for a model automatically

acts_as_seo_friendly / test / seo_test_resource_method_model.rb
100644 10 lines (8 sloc) 0.239 kb
1
2
3
4
5
6
7
8
9
10
class SeoTestResourceMethodModel < ActiveRecord::Base
  set_table_name :seo_test_models
  #use a method as a resource id
  acts_as_seo_friendly :seo_friendly_id_field => :seo_id, :resource_id => :foo
  
  def foo
    self.name
  end
  
end