Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

page_parts

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

page_parts

  • 0.1.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

PageParts

Build Status

Enable dynamic string attributes 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

Setup fields at your model:

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

  page_parts :content, :sidebar
end

Use fields as normal attributes:

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

Setup fields with suffixes:

page_parts :sidebar, suffix: [:en, :uk]

page_parts :content, suffix: I18n.available_locales

It generates attributes: sidebar_en, sidebar_uk

Tests

rake test

Copyright (c) 2012 Fodojo, released under the MIT license

FAQs

Package last updated on 07 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc