Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Full-stack asset management for Ruby on Rails. With Paperclip, SWFUpload, jQuery, jgrow, Jcrop and Facebox.
JavaScript Ruby

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
generators/papermill
lib
public
rails
tasks
test
.gitignore
MIT-LICENSE
README.rdoc
Rakefile
VERSION
init.rb
install.rb
papermill.gemspec
uninstall.rb

README.rdoc

Papermill

Asset management made easy.. Painfully easy. Try the demo to see for yourself.

See papermill_module.rb for a complete list of available options. These options can be application wide, for a class, or set at the last moment for the helper.

You'll need something like this in your environment.rb

config.gem 'rsl-stringex', :lib => 'stringex', :source => 'http://gems.github.com'
config.gem 'paperclip'
config.gem 'authlogic'
config.gem 'mime-types', :lib => 'mime/types'
config.gem 'ryanb-acts-as-list', :lib => 'acts_as_list', :source => 'http://gems.github.com'
config.gem 'BBenezech-papermill', :lib => 'papermill', :source => 'http://gems.github.com'

Then install the whole thing:

sudo gem install ryanb-acts-as-list -s http://gems.github.com
sudo gem install paperclip
sudo rake gems:install # will install the others gem. You need to install paperclip & acts_as_list first, because of a dependency mayhem.
./script/generate papermill PapermillMigration # will also copy a couple of static assets
rake db:migrate

In your assetable model:

papermill :assets

In your layout:

<%= papermill_stylesheet_tag %>
<%= papermill_javascript_tag :with_jquery => true %>
# you don't need :with_jquery if it is already loaded, obviously.

In your edit form:

f.images_upload(:my_image_gallery)
f.image_upload(:header_image)

Finally, in your views:

# Some template image : 
<%= image_tag @article.assets(:header_image).first.url("800x>") %>

# Some image gallery:
<ul>
  <% @article.assets(:my_image_gallery).each do |image| %>
    <li><%= link_to(image_tag(image.url("100x100>")), image.url) %></li>
  <% end %>
</ul>

Also see gist.github.com/177714.txt to get up-to-date installation steps. See the API here rdoc.info/projects/BBenezech/papermill

Word of caution:

Beta.

This is xNIX only (system(“rm …”)).

You'll need rails 2.3, since this is an engine. Anyway, copying the controller/view/routes to your project will make it work on an older version of rails.

You'll need rails 2.2, since their are calls to I18n.t. But it shouldn't be too hard to work-around either.

Usage :

Demo :

You can use the custom template generator to get an example application up and running in no time.

rails -m http://gist.github.com/177714.txt papermill-example

Translation:

Papermill is fully Rails 2.2 I18n-able.

Copy config/locale/papermill.yml to your root config/locale folder to modify any wording in a any locale.

Copyright © 2009 Benoit Bénézech, released under the MIT license

Something went wrong with that request. Please try again.