# Advice on changing actions when in process flow and out of i

**URL:** <https://www.ruby-forum.com/t/advice-on-changing-actions-when-in-process-flow-and-out-of-i/114757>\
**Category:** Rails\
**Created:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/advice-on-changing-actions-when-in-process-flow-and-out-of-i/114757 "2007-09-17T13:25:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephen\_OSD](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@stephen\_OSD](https://www.ruby-forum.com/u/stephen_OSD)\
**Post date:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/advice-on-changing-actions-when-in-process-flow-and-out-of-i/114757/1 "2007-09-17T13:25:14Z")

</div>

Guys,

Say I have an action, :new, that allows a user to create a new ‘item’  
in my app. To create this new item, they have to move through several  
steps, first add some details (in :new which creates the item), then  
add details (in :manage\_details), then issue the ‘item’ (in :issue).

I also have a :view action that allows someone to see all details  
about their item, with links to each of the actions required in the  
flow above to change things about it, or set them up if they broken  
out of the flow after step 1.

The actions linked to from :view are the same as those in the ‘new  
process flow’, but, in the new flow I want links to the next item in  
the flow, and a ‘step X of Y’ displayed, but I don’t want them when  
not in the new flow, other than that the actions are identical.

What is the best way to do this?

Should I pass parameters the actions when in the ‘new flow’ (but then  
I have to pass the parameters around to other actions which could be  
messy).

Should I use the session and somehow notice that the user has strayed  
off the flow (also messy, as a user could open a link in a new window,  
and how do I notice they have strayed off the flow path)?

Should I use referrer somehow, or should I create almost duplicate  
actions that render the same partial with slightly different wrapper  
around it in each case?

I know there are ways I can make this work - basically I am looking  
for some advice on the best way - everything I can think of seems  
quite tricky!

Thanks,

Stephen
