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

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.
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
Access
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
some
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
a
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
Purchase
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|
%>
  <li>
  <% c_human_name = c_class.name.demodulize[0..-11].underscore.humanize
%>
  <%= link_to_unless_current_controller(c_class,
                                        c_human_name,
                                        { :controller => '/' +
                                            c_class.controller_path })
%>
  </li>
<% end %>
</ul>

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

Thanks,
~d
This topic is locked and can not be replied to.