The issue here really lies in reusable subcomponents of functionality, of any granularity of your choosing (i.e. objects)<br><br>Presently helpers are your best bet in this respect, but what happens when you have something so complex it needs to retain state?&nbsp; In that case, the procedural approach exposed by the helper API grows increasingly insufficient.
<br><br>- Tony<br><br><div><span class="gmail_quote">On 5/18/07, <b class="gmail_sendername">David Clements</b> &lt;<a href="mailto:david@collectiveintellect.com">david@collectiveintellect.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Not sure if I am totally following the issue here. I totally agree<br>with the premise that the support for widgetizing our apps is really<br>ugly. And I use components regularly to widgetize various portions of<br>our apps.
<br><br>Are we talking about syntax or functionality?<br><br>We could re-write your example today using render_component_as_string:<br><br>class FooController &lt; ApplicationController<br>&nbsp;&nbsp; def bar<br>&nbsp;&nbsp;&nbsp;&nbsp; # get a handle on, and parameterize, a bar controller
<br>&nbsp;&nbsp;&nbsp;&nbsp; bar_controller = component_for(:controller =&gt; &#39;bar&#39;) do<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @foo = 42<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @bar = &#39;forty-two&#39;<br>&nbsp;&nbsp;&nbsp;&nbsp; end<br><br>&nbsp;&nbsp;&nbsp;&nbsp; # call two actions on the bar controller, potentially reusing<br>
the entire model+view+controller stack<br>&nbsp;&nbsp;&nbsp;&nbsp; foo = bar_controller.content_for :action =&gt; &#39;foo&#39;<br>&nbsp;&nbsp;&nbsp;&nbsp; bar = bar_controller.content_for :action =&gt; &#39;bar&#39;<br><br>&nbsp;&nbsp;&nbsp;&nbsp; render :text =&gt; [foo, bar].inspect #=&gt; [42, &quot;forty-two&quot;]
<br>&nbsp;&nbsp; end<br>end<br><br><br>With this:<br><br>class FooController &lt; ApplicationController<br>&nbsp;&nbsp; def bar<br>&nbsp;&nbsp;&nbsp;&nbsp; params_hash = {:foo =&gt; 42, :bar =&gt; &#39;forty_two&#39;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp; # call two actions on the bar controller, potentially reusing
<br>the entire model+view+controller stack<br>&nbsp;&nbsp;&nbsp;&nbsp; foo = render_component_as_string( params_hash.merge(:controller<br>=&gt; &quot;bar&quot;, :action =&gt; &quot;foo&quot; )<br><br>&nbsp;&nbsp;&nbsp;&nbsp; bar = render_component_as_string( params_hash.merge(:controller
<br>=&gt; &quot;bar&quot;, :action =&gt; &quot;bar&quot; )<br><br>&nbsp;&nbsp;&nbsp;&nbsp; render :text =&gt; [foo, bar].inspect #=&gt; [42, &quot;forty-two&quot;]<br>&nbsp;&nbsp; end<br>end<br><br><br>Not sure if I am missing something,&nbsp;&nbsp;as I didn&#39;t here Bruce&#39;s talk
<br>last week,<br><br>Dave<br><br><br><br><br>On May 18, 2007, at 4:41 PM, Peter Jones wrote:<br><br>ara.t.howard wrote the following on Fri, May 18, 2007 at 02:16:54PM<br>-0600:<br>&gt; i&#39;d love feedback from the community
<br><br><br>Ara, this stuff looks pretty good.&nbsp;&nbsp;Like you, I tend to gravitate<br>towards OOP,<br>and it&#39;s disappointing that with Rails, MVC is only 1/3 OO.&nbsp;&nbsp;I&#39;m<br>wondering if<br>it&#39;s time to rethink ActionController and ActionView a bit.
<br><br><br><br><br><br><br>--<br>Peter Jones - 303-669-2637<br>pmade inc.&nbsp;&nbsp;- <a href="http://pmade.com">http://pmade.com</a><br>_______________________________________________<br>Bdrg-members mailing list<br><a href="mailto:Bdrg-members@rubyforge.org">
Bdrg-members@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/bdrg-members">http://rubyforge.org/mailman/listinfo/bdrg-members</a><br><br>_______________________________________________<br>Bdrg-members mailing list
<br><a href="mailto:Bdrg-members@rubyforge.org">Bdrg-members@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/bdrg-members">http://rubyforge.org/mailman/listinfo/bdrg-members</a><br></blockquote></div><br>
<br clear="all"><br>-- <br>Tony Arcieri<br>ClickCaster, Inc.<br><a href="mailto:tony@clickcaster.com">tony@clickcaster.com</a><br>720-227-0129 ext. 202