Forum: Ruby on Rails acts_as_wizard clone

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F6f1bb179f57640efd981e3a18448f71?d=identicon&s=25 idealguru@gmail.com (Guest)
on 2007-06-20 21:47
(Received via mailing list)
Is there an 'acts_as_wizard' clone that provies similar
functionality ? The original plugin seems to be in an unmaintained
state and doesn't work with Rails 1.2
F6f1bb179f57640efd981e3a18448f71?d=identicon&s=25 idealguru@gmail.com (Guest)
on 2007-06-24 08:26
(Received via mailing list)
Just to clarify - I am trying to implement multi-step forms.
F6f1bb179f57640efd981e3a18448f71?d=identicon&s=25 idealguru@gmail.com (Guest)
on 2007-06-26 22:00
(Received via mailing list)
:ahem .. is my question undeserving of a reply ?? is it something
obvious I am missing in Rails
B09a3f6cdc4797532647d2d264b5df49?d=identicon&s=25 Jodi Showers (jshow)
on 2007-06-26 22:10
(Received via mailing list)
On 26-Jun-07, at 3:59 PM, idealguru@gmail.com wrote:

>>> functionality ? The original plugin seems to be in an unmaintained
>>> state and doesn't work with Rails 1.2
>

no IG. there's not always the collective bandwidth to answer all
questions. grin.

I've never used this plugin, but was relatively easy to implement

I suggest DIY

* first carry a column to hold the current wizard stage - I called
mine 'stage'

* then when you render use the stage number as part of the partial name.

* render :partial => "wizard_stage_#{@encounter.current_stage}"

* next will increment the stage, previous will decrement.

* then name your partials with an _x for the appropriate stage.

BTW, The advantage of storing stage are that you can support the
resumption of the wizard.

As an additional thought you can have stage specific field
validations by checking the stage value:

   validates_presence_of :age, :if => :at_stage_two, :message => "
must be entered"

the above should be enough to get you moving forward.

cheers,
Jodi
This topic is locked and can not be replied to.