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

matic_grid

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

matic_grid

  • 0.0.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Summary

Mongomatic::Plugins::Grid is a Grid plugin for Mongomatic

Support is built in for rack_grid and rack_grid_thumb to generate URLS and thumbnails: http://github.com/dusty/rack_grid http://github.com/dusty/rack_grid_thumb

Installation

gem install matic_grid

Usage

require 'matic_grid'

class Monkey < Mongomatic::Base include Mongomatic::Plugins::Grid

attachment :image, :prefix => 'grid'

end

m = Monkey.new(:name => 'name').insert

To add an attachment

m.image = File.open('/tmp/me.jpg') m.update

To remove an attachment

m.image = nil m.update

To get the attachment

m.image.read

To get the URL for rack_grid

m.image_url # /grid/4e049e7c69c3b27d53000005/me.jpg

To get the thumbail URL for rack_grid_thumb

m.image_thumb('50x50') # /grid/4e049e7c69c3b27d53000005/me_50x50.jpg

Inspired By

FAQs

Package last updated on 30 Jun 2011

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