iprog.com

Rails 2.3 compatible version of limited_sessions is ready

Rails 2.3 made a lot of changes in how requests are handled. Most (all?) of this has to do with its new support for Rack. Anyway, all of these changes left Rails 2.3 incompatible with the last version of the Limited Sessions plugin.

So, here’s a shiny new version of Limited Sessions to go with your shiny new version of Rails.

Read more...

0 comments

Rails plugin Limited Sessions updated

I updated my limited_sessions plugin to improve support for Rails 2.1. It should maintain backwards compatibility.

The change surrounds Rails 2.1’s new partial updates support. Basically, it’s turned off for sessions so the session is kept current and doesn’t expire if the user is active.

limited sessions

3 comments

new limited_sessions plugin for rails

it’s time to announce my second plugin for ruby on rails, limited_sessions.

it’s been publicly available for several days, so i guess it’s time that i actually talk about it.

this came out of a need to manage sessions more intelligently than rails does by default. all of these is built as an extension to ActiveRecordStore, so sessions must be stored in the db. features:

as usual, details are on the project page.

9 comments

announcing db_log_cleaner rails plugin

my first public rails plugin is ready to go. called db_log_cleaner, it’s a more complete version of another plugin called postgre_log_cleaner.

it filters out selected log messages from both postgres and mysql to help keep development.log cleaner.

details are on the project page.

0 comments

uploading multiple files with attachment_fu

i was recently sharing with someone how to make multiple uploads work with the attachment_fu plugin. as an aside, attachment_fu is the successor to acts_as_attachment. if you were planning to use acts_as_attachment, upgrade your plans and use attachment_fu instead.

multiple file uploads are actually fairly straight forward.

first, in the view:

1<%= file_field_tag 'attachment_data[]' %>

put as many of these in the view as desired. it’s also easy to cause an arbitrary number of them to be added via javascript by the user’s browser.

then, in the controller:

1@attachment = Attachment.new
2params[:attachment_data] ||= []
3params[:attachment_data].each do |file|
4  @attachment = Attachment.create({:uploaded_data => file}) unless file == ""
5end

Attachment is my model for uploaded file—substitute as appropriate. as this isn’t a complete how-to for attachment_fu, i won’t get into configuring attachment_fu or the model here.

that’s it. that wasn’t so painful, eh?

21 comments