Sha256: 5851664efec62c41745a1c0924c15d72611b3a16e4172d9e85e86b0e808bb9e7

Contents?: true

Size: 263 Bytes

Versions: 4

Compression:

Stored size: 263 Bytes

Contents

module PrettyUrl
  extend ActiveSupport::Concern

  included do
    before_save :update_url_name
  end

  def to_param
    url_name
  end

  private
  def update_url_name
    self.url_name = name.parameterize if name_changed? and !url_name_changed?    
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pixelforce_cms-1.0 lib/generators/pixelforce_cms/templates/pretty_url.rb
pixelforce_cms-0.9.9.9 lib/generators/pixelforce_cms/templates/pretty_url.rb
pixelforce_cms-0.9.9.8 lib/generators/pixelforce_cms/templates/pretty_url.rb
pixelforce_cms-0.9.9.7 lib/generators/pixelforce_cms/templates/pretty_url.rb