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

middleman-decorators

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

middleman-decorators

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Middleman Decorators

Build Status Dependency Status

Use Decorators (AKA Presenters) in Middleman. This project is not yet stable so use with caution.

Installation

Add this line to your application's Gemfile:

gem 'middleman-decorators', '~> 1.0'

And then execute:

$ bundle install

Usage

Activate the extension in config.rb:

activate :decorators

By default, decorators are added to $app_root/decorators

Example decorator:

class WidgetDecorator < Middleman::Decorators::Base
  def complex_method
    [..]
  end
end

To use the decorator in a view:

<% decorate(data.widgets, WidgetDecorator).complex_method %>

Contributing

If there is any thing you'd like to contribute or fix, please:

  • Fork the repo
  • Make your changes
  • Add specs for any new functionality
  • Verify all existing tests work properly
  • Make a pull request

FAQs

Package last updated on 21 Sep 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