
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
pelargir-image_picker
Advanced tools
= image_picker
A simple, customizable image browser.
== Installation
Install the gem directly:
gem sources -a http://gems.github.com (you only have to do this once) sudo gem install pelargir-image_picker
Or install the gem in your Rails project as a plugin:
script/plugin install git://github.com/pelargir/image_picker.git
Or clone the project:
git clone git://github.com/pelargir/image_picker.git
Then copy the required image, JS, and CSS files into your Rails project
rake image_picker:install_files
== Usage
First, add the picker to your view and pass it the name of the image being picked. This name is used to create a hidden field that stores the database ID of the image that gets picked:
<%= image_picker :avatar %>
Now tell your controller that you'll be picking images, and which ActiveRecord model you'll be using:
class SomeController < ActionController::Base image_picker :model => Image end
The ActiveRecord class must respond to three method calls:
thumbnail: the path to the image's thumbnail (e.g. /images/foo_small.gif) title: a friendly title for the image description: a description of the image (optional)
That's it! The picker will show up in your view and, once you've picked an image, its database ID will be set as the value of the hidden field "_id" where is the name you passed to the image_picker helper in your view. The hidden field can then be submitted via a form or referenced in JavaScript.
== Other Options
The controller helper accepts any arguments you can pass to an ActiveRecord finder. For example:
class SomeController < ActionController::Base image_picker :model => Image, :order => "created_at DESC" end
If the will_paginate plugin is installed, the image picker will use it automatically. You can pass pagination options to the controller helper as well. For example:
class SomeController < ActionController::Base image_picker :model => Image, :per_page => 6 end
== Resources
Repository: http://github.com/pelargir/image_picker/ Blog: http://matthewbass.com Author: Matthew Bass
Extraction work sponsored by Terralien
FAQs
Unknown package
We found that pelargir-image_picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.