Can you explain this a little more? I understand polymorphics, but
still trying to grok simply_helpful, so I'm not exactly sure what
these arrays are doing in there.
(Feel free to push this thread to rubyonrails-talk if that's more
appropriate).
Essentially, simply_helpful's form_for helper will try to figure out
the correct URL that it should be POSTing to based on the object you
give it. If the form is for @workshop (<% form_for @workshop do ...
%>), with is an instance of Workshop, the form will POST to /workshops
(or PUT to /workshops/123 if editing a saved instance).
If you were editing a nested resource (i.e.
/workshops/123/sessions/456), the url generation in simply_helpful did
not correctly use those nested resources. By passing an array of
objects, it's now possible for the form action url to be inferred
based on the classes of the objects in that array.
I haven't looked at how the patch here actually works, but the logic
might be something like this:
1. take the last element of the array, since that's the most-inner
of the nested resources. In this case, that's @session
2. infer the named route method based on that object's class, and
then pass the array as arguments to that array. So, what ends up being
called is