Original announcement at http://blog.inquirylabs.com/ [1]
== What is bundled_resource? ==
If your development is in any way similar to mine, there are a number
of useful resources out there that make web applications shine
beautifully. For example, thereâ??s the Dynarch calendar and the
textarea tools. There are a number of othersâ??too many, in fact. The
problem is that as a web developer, it sometimes takes some real
surgery to put each one of these in to an application. And then when
you create a new page that uses these resources (even within the same
app), you have to figure out which pieces to cut and paste to get it
functional. Take the Dynarch calendar, for instance. There are 4
javascript files, 1 CSS file (among several to choose from), 2
images, several helper methods, and a controller method that youâ??ll
need in order to get it to work with Rails. Sometimes itâ??s easier
just to ignore the calendar bit because itâ??s such a pain to set up.
The bundled_resource plugin makes it trivially easy to keep all of
these pieces together, and to include each “bundle” with a single
method, require_bundle, wherever the bundle is needed.
== Examples ==
<%= require_bundle :dynarch_calendar,
:color => ‘green’,
:language => ‘en’,
:icon => ‘/images/my_calendar.gif’ %>
<%= dynarch_date_select ‘user’, ‘birthday’ %>
<%= dynarch_datetime_select ‘user’, ‘lunch_meeting’ %>
== What’s new in v. 0.9? ==
This release marks a much improved and nearly completely rewritten
dynarch calendar bundle.
Hereâ??s whatâ??s new:
It is no longer necessary to call convert_date_to_multi_params! in
your controller
Backwards compatibility for non-javascript browsers is now improved.
Calling dynarch_date_select will call the built-in rails date_select
method so that users whose browsers have no javascript can still
select a date in a reasonable way.
There is no longer an obnoxious â??:dateâ? field in the returned
multiparameter values.
Bundles now accept optional parameters. For the dynarch_calendar
bundle, you can specify the color stylesheet, language and icon for
your dynarch calendar.
12-hour time is handled in a novel way, so that the user enters a 12-
hour time (e.g. 3 PM) and Rails can read it as if itâ??s a 24-hour time.
Better documentation.
Version 0.9 of bundled_resource now also includes a â??stateful_formâ?
bundle that makes it easier to store the open/closed states of form
sections. This is particularly useful for AJAX forms that have hidden
sections that the user can open up. When the form is submitted to the
server and returned with an error, the form will retain its open/
closed states so that itâ??s just as the user expects it.
== Download and Subversion ==
TAR / GZIP: http://inquirylabs.com/downloads/bundled_resource-0.9.tgz
Subversion: svn://syncid.textdriven.com/svn/opensource/
bundled_resource/trunk
[1] The permalink is http://blog.inquirylabs.com/2006/01/26/bundled-
resource-v-09-full-dynarch-calendar-support/