Sha256: 9c88308c7afef89634f9c4b1b2ca5a3f66557cb4fe4ac306ca208e0f0d57439e

Contents?: true

Size: 328 Bytes

Versions: 9

Compression:

Stored size: 328 Bytes

Contents

class Page < ::ApplicationContentModel
  variables :layout, :date, :published, :title, :subtitle, :tags, :permalink

  def generate_new_file_path
    slug = if title
      title.gsub(/['|"]/,'').parameterize
    else
      "untitled_#{self.class.name.parameterize}"
    end

    self.class.absolute_path("#{slug}.md")
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
yarii-editor-0.4.8 app/models/page.rb
yarii-editor-0.4.7 app/models/page.rb
yarii-editor-0.4.6 app/models/page.rb
yarii-editor-0.4.5 app/models/page.rb
yarii-editor-0.4.4 app/models/page.rb
yarii-editor-0.4.3 app/models/page.rb
yarii-editor-0.4.2 app/models/page.rb
yarii-editor-0.4.1 app/models/page.rb
yarii-editor-0.4.0 app/models/page.rb