<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Ruby on Rails with Flex</title>
	<atom:link href="http://unitedmindset.com/jonbcampos/2009/05/30/ruby-on-rails-with-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://unitedmindset.com/jonbcampos/2009/05/30/ruby-on-rails-with-flex/</link>
	<description>Jonathan Campos&#039;s Blog about Flex and the Flash Platform</description>
	<lastBuildDate>Thu, 11 Mar 2010 15:15:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: abhishek</title>
		<link>http://unitedmindset.com/jonbcampos/2009/05/30/ruby-on-rails-with-flex/comment-page-1/#comment-614</link>
		<dc:creator>abhishek</dc:creator>
		<pubDate>Fri, 26 Feb 2010 09:10:08 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=300#comment-614</guid>
		<description>http://abhisheksoft.wordpress.com/2009/06/19/9/</description>
		<content:encoded><![CDATA[<p><a href="http://abhisheksoft.wordpress.com/2009/06/19/9/" rel="nofollow">http://abhisheksoft.wordpress.com/2009/06/19/9/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adobe Flex + Ruby on Rails (+ RubyAMF) = &#8216;RIA Nirvana&#8217; at stanowcze unikanie wi?cej ni? trzech kropek w bezposrednim s?siedztwie</title>
		<link>http://unitedmindset.com/jonbcampos/2009/05/30/ruby-on-rails-with-flex/comment-page-1/#comment-528</link>
		<dc:creator>Adobe Flex + Ruby on Rails (+ RubyAMF) = &#8216;RIA Nirvana&#8217; at stanowcze unikanie wi?cej ni? trzech kropek w bezposrednim s?siedztwie</dc:creator>
		<pubDate>Wed, 03 Feb 2010 17:27:01 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=300#comment-528</guid>
		<description>[...] troch? wi?cej czasu i poszuka?em materia?ów w internecie. Natrafi?em na wpis w blogu Ruby on Rails with Flex i z jego pomoc? uda?o mi si? dotkn?? r?bka &#8216;RIA [...]</description>
		<content:encoded><![CDATA[<p>[...] troch? wi?cej czasu i poszuka?em materia?ów w internecie. Natrafi?em na wpis w blogu Ruby on Rails with Flex i z jego pomoc? uda?o mi si? dotkn?? r?bka &#8216;RIA [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Campos</title>
		<link>http://unitedmindset.com/jonbcampos/2009/05/30/ruby-on-rails-with-flex/comment-page-1/#comment-451</link>
		<dc:creator>Jonathan Campos</dc:creator>
		<pubDate>Mon, 28 Dec 2009 21:48:16 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=300#comment-451</guid>
		<description>@michael The routes shouldn&#039;t matter if you are accessing the data via AMF. You just need to send the correct vars to your controller to receive back the array of policies. Such as:
&lt;code lang=&quot;ruby&quot; width=&quot;490&quot;&gt;
ClientController &gt; ApplicationController

   def get_client_policies_by_id
             ...
             @client_id = params[:client_id]
             @policies = #your activerecord code to get policies#
             ...
             render :amf =&gt; @policies
   end

end
&lt;/code&gt;

And in Flex you would just get the result from your service.
&lt;code lang=&quot;actionscript&quot; width=&quot;490&quot;&gt;
   &lt;mx:Script&gt;
   &lt;![CDATA[
          private function _onSomeUserGesture(event:MouseEvent):void
          {
               service.send({client_id:selectedClient.id});
           }

          private function _onResult(event:ResultEvent):void
          {
              //do something with the result
          }
   ]]&gt;
   &lt;/mx:Script&gt;
   &lt;mx:RemoteObject id=&quot;service&quot; destination=&quot;rubyamf&quot; endpoint=&quot;..your/path/to/rubyamf/gateway&quot; source=&quot;ClientController&quot;&gt;
    &lt;mx:Method name=&quot;get_client_policies_by_id&quot; result=&quot;onResult(event)&quot;/&gt;
   &lt;/mx:RemoteObject&gt;
&lt;/code&gt;

HTH</description>
		<content:encoded><![CDATA[<p>@michael The routes shouldn&#8217;t matter if you are accessing the data via AMF. You just need to send the correct vars to your controller to receive back the array of policies. Such as:</p>
<div class="codecolorer-container ruby dawn" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ClientController <span style="color:#006600; font-weight:bold;">&gt;</span> ApplicationController<br />
<br />
&nbsp; &nbsp;<span style="color:#9966CC; font-weight:bold;">def</span> get_client_policies_by_id<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0066ff; font-weight:bold;">@client_id</span> = params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:client_id</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0066ff; font-weight:bold;">@policies</span> = <span style="color:#008000; font-style:italic;">#your activerecord code to get policies#</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;...<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#9900CC;">render</span> <span style="color:#ff3333; font-weight:bold;">:amf</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@policies</span><br />
&nbsp; &nbsp;<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></td></tr></tbody></table></div>
<p>And in Flex you would just get the result from your service.</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp;<span style="color: #66cc66;">&lt;</span>mx:Script<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp;<span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _onSomeUserGesture<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;service.<span style="color: #0066CC;">send</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>client_id:selectedClient.<span style="color: #006600;">id</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _onResult<span style="color: #66cc66;">&#40;</span>event:ResultEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//do something with the result</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp;<span style="color: #66cc66;">&lt;/</span>mx:Script<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp;<span style="color: #66cc66;">&lt;</span>mx:RemoteObject id=<span style="color: #ff0000;">&quot;service&quot;</span> destination=<span style="color: #ff0000;">&quot;rubyamf&quot;</span> endpoint=<span style="color: #ff0000;">&quot;..your/path/to/rubyamf/gateway&quot;</span> source=<span style="color: #ff0000;">&quot;ClientController&quot;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>mx:Method <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;get_client_policies_by_id&quot;</span> result=<span style="color: #ff0000;">&quot;onResult(event)&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp;<span style="color: #66cc66;">&lt;/</span>mx:RemoteObject<span style="color: #66cc66;">&gt;</span></div></td></tr></tbody></table></div>
<p>HTH</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MichaelG</title>
		<link>http://unitedmindset.com/jonbcampos/2009/05/30/ruby-on-rails-with-flex/comment-page-1/#comment-450</link>
		<dc:creator>MichaelG</dc:creator>
		<pubDate>Mon, 28 Dec 2009 21:29:48 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=300#comment-450</guid>
		<description>I&#039;m just starting to use AMF.  I don&#039;t have experience using calls thru RemoteObject other than just a controller&#039;s index, returning all records.

I would like to make calls to controllers using associations:
i.e.: Client has_many Policies, so I need to get a result set of:
/clients/[id]/policies

How would I call that from Flex?
Currently Routes is already set up correctly and it&#039;s returning appropriate record set from an HTML version of the call.</description>
		<content:encoded><![CDATA[<p>I&#8217;m just starting to use AMF.  I don&#8217;t have experience using calls thru RemoteObject other than just a controller&#8217;s index, returning all records.</p>
<p>I would like to make calls to controllers using associations:<br />
i.e.: Client has_many Policies, so I need to get a result set of:<br />
/clients/[id]/policies</p>
<p>How would I call that from Flex?<br />
Currently Routes is already set up correctly and it&#8217;s returning appropriate record set from an HTML version of the call.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
