
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
h1. Ample Assets
AmpleAssets is a mountable engine that provides drag & drop file-management for Rails 3.2 applications.
!http://helloample.com/images/work/screen-shot.png!
h3. Example Usage
Add the following to your Gemfile and bundle...
gem 'ample_assets', :git => 'https://github.com/ample/ample_assets.git'
Run the generator to copy over the necessary migrations...
rails g ample_assets:install
You'll need to create a foreign_key on the model with which you plan to integrate AmpleAssets. For the purposes of this example, let's assume your model is named @Post@...
rails g migration add_file_id_to_posts file_id:integer
Now you're ready to migrate...
rake db:migrate
Add the following plugin to your model...
class Post < ActiveRecord::Base
...
has_asset
...
end
In both of your manifest files (stylesheets & javascripts) require ample_assets, for example...
/**
*= require ample_assets
*/
Add the engine to your app's routes.rb file...
mount AmpleAssets::Engine => "/ample_assets", :as => "ample_assets"
To invoke the asset toolbar, include the following in any view...
<%= assets_toolbar %>
To invoke a new drop_target, include the following within a form attached to your model...
<%= form_for current_page do |f| %>
<%= f.asset_drop(:file_id) %>
<% end %>
h3. Configuration
AmpleAssets.configure do |config|
config.mount_at = YOUR PATH PREFIX
end
If your model's attribute is named something different, you can still create the association by passing a symbol to the has_asset plugin, like so...
class YourModel < ActiveRecord::Base
...
has_asset :some_attr
...
end
Now you can invoke a drop target for your unique attribute like this...
<%= form_for @object do |f| %>
<%= asset_drop(:your_model, :some_attr_id, :object => f.object.some_attr) %>
<% end %>
FAQs
Unknown package
We found that ample_assets demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.