Forum: Ruby on Rails Check condition before rendering action using link_to_unless

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Damon H. (Guest)
on 2005-12-13 20:39
(Received via mailing list)
Good day!

I have a typical purchase order system that I am moving from a legacy
platform to a Rails platform.
I am obviously trying to change as little as possible from the GUI
standpoint so as not to confuse the current users.

Therefore, when generating a new Purchase Order, the user must enter
pertinent information into the form.
After entering the information, they are to proceed to a Purchase Order
Detail screen where they will enter products associated with the new
purchase order.

What I want to do, is require the user to save the Purchase Order
information before they proceed to the Purchase Order Detail screen.
Obviously doing this seamlessly would be ideal, but if I have to produce
pop-up of some sort (even an AJAX dialog) would be fine.

I currently have the following code in the top of my view on the
Order form:

<center><h1>New Traded Purchase Order</h1></center>
<ul id="primary">
  # List of all the controllers here.
  [ PurchaseOrderController,
    PurchaseOrderDetailController ].each do |c_class|
  <% c_human_name =[0..-11].underscore.humanize
  <%= link_to_unless_current_controller(c_class,
                                        { :controller => '/' +
                                            c_class.controller_path })
<% end %>

Is there any "easy" way to modify the code to add this check
to save the PO before proceeding to the PurchaseOrderDetail screen?

This topic is locked and can not be replied to.