Damon Hill
2005-Dec-13 18:38 UTC
Check condition before rendering action using link_to_unless
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 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails