(removed and re-posted) An alternative strategy, assuming your app can use javascript on the client, would be to confirm the user's action first via javascript on the client-side before allowing the user to submit the form back to the server.
There are many ways to do this, but the one I use most these days is to have a (default) hidden div that contains the confirmation, such that when the user clicks on the (pre-confirmed) action button, the div is shown to the user and they must confirm the action to submit the data or cancel the confirmation to keep working on the data. Something like the following (although much better javascript alts using one of the various js libs): # html/css: ... <input type="button" value="Save" onclick="toggle_hide_show(document, 'confirm_save')" /> <div id="confirm_save" style="display:none"> Are you sure? <input type="submit" name="act_confirm_save" value="Confirm save" / > <input type="button" value="Cancel" onclick="toggle_hide_show(document, 'confirm_save')" /> </div> ... # javascript: ... function toggle_hide_show(doc, div_id){ if(doc.getElementById(div_id).style.display == 'none'){ doc.getElementById(div_id).style.display = 'block'; }else{ doc.getElementById(div_id).style.display = 'none'; } } ... Jeff On Apr 14, 4:44 pm, David Zhu <dzwestwindso...@gmail.com> wrote: > thanks, > > hmm if i make a seperate contrller, then how would i transfer my items > there to confirm the transaction? > > Is it possible to transfer varialbes between contrllers or do i have > to make a seperate table? Thanks > > On Apr 14, 6:48 pm, Michael Pavling <pavl...@gmail.com> wrote: > > > > > On 14 April 2010 23:23, David Zhu <dzwestwindso...@gmail.com> wrote: > > > > But i was just wondering, by adding that confirm action in that > > > controller, does it violate the Restful Resources rules? > > > It does break the principles of REST, but if you're not that worried > > about being RESTful, there's no problem. > > > If you do want to follow rest, instead of putting the confirm action > > in the ProductController, create a new controller > > (ProductConfirmController, maybe) that does the functions of the > > confirm in it's create method. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.