Javascript, Helpers and DRY


I’m using the calendar_helper plugin to generate javascript for popup
calendars. It works nicely.

Now, I’d like to create a Ajax.InPlaceDateEditor in the javascript libs,
that when a user clicks a date field they’ll be given an in place editor
that can be set with a popup calendar. I’ve done similar things in the
but only when I wasn’t using helpers to generate controls. I’m
with how to keep this DRY…is there any way you can think of to make
use of
the logic contained within the calendar_helper methods…but from
within an
inplaceeditor? The only rough guess I have at the moment is making an
call in the background to a controller method that would call the helper
return the outputted javascript, but somehow this feels dirty.

Any suggestions will be very much appreciated. If I rambled too much for
to understand what I’m trying to do, just say so and I’ll back up an
myself. I’m going on too much coffee this morning.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs