Prev: Different behavior of '$,' output separator in Ruby 1.9
Next: Buy Genuine Google Adsense Account only for Rs.200/- for indian people.
From: Sven S. on 8 Mar 2010 05:28
> If you can't use the resource oriented form of form_for which lets
> Rails figure out the method based on whether the resource is new or
> existing, then why not handle it on the other side of the interface
You're right. However, I was wondering if there were a solution that
would be both simple and stay in the view.
As a matter of fact, form_for figures the method out just fine and so
does semantic_form_for (from Formtastic). For admin backends, however,
I'm using the "show view" for deleting resources as well, so the method
should be :delete then. And that's when - and *only* when - I'd need to
I like Cory's one liner, it's an acceptable solution for the time being.
Posted via http://www.ruby-forum.com/.