PageParts

Enable page parts in your model

Install

gem "page_parts"

ActiveRecord:

require 'page_parts/orm/active_record'

rake page_parts_engine:install:migrations

Mongoid:

require 'page_parts/orm/mongoid'

Usage

class Category < ActiveRecord::Base
  include PageParts::Extension

  validates_presence_of :title

  page_parts :content, :sidebar
end

@category = Category.new
@category.content = "Some text"
@category.sidebar = "Sidebar text"
@category.save

With suffixes:

page_parts :main, :left, :sidebar, :suffix => [:ru, :en, :uk]

Generates main_ru, main_en, main_uk, left_ru …

Test

rake test

Copyright © 2012 Fodojo, released under the MIT license