最近无聊下载了netbeans 6.9 beta版本玩了玩。
发现jruby和rails用用也挺好的
一直希望用ror+amf3+flex开发点什么.顺便试了下rubyamf
1.创建一个ror项目
2.安装插件ruby script/plugin install http://rubyamf.googlecode.com/svn/tags/current/rubyamf
(该插件的博客地址:http://blog.rubyamf.org/)
3.加上测试的control
class HelloWorldController < ApplicationController
def say_hi
render :amf => 99;
# render :html => "@project"
end
end
4.在flex上用(用mate框架的例子直接改的)
<EventHandlers type="{QuoteEvent.GET}" debug="true"> <RemoteObjectInvoker destination="rubyamf" source="HelloWorld" method="say_hi" arguments="{event.symbol}" debug="true"> <resultHandlers> <MethodInvoker generator="{QuoteManager}" method="storeQuote" arguments="{resultObject}"/> </resultHandlers> </RemoteObjectInvoker> </EventHandlers>
5.service-config.xml
<?xml version="1.0" encoding="UTF-8"?> <services-config> <services> <service id="rubyamf-service" class="flex.messaging.services.RemotingService" messageTypes="flex.messaging.messages.RemotingMessage"> <destination id="rubyamf"> <channels> <channel ref="my-rubyamf"/> </channels> <properties> <source>*</source> </properties> </destination> </service> </services> <channels> <channel-definition id="my-rubyamf" class="mx.messaging.channels.AMFChannel"> <endpoint uri="http://localhost:3000/rubyamf/gateway" class="flex.messaging.endpoints.AMFEndpoint"/> </channel-definition> </channels> </services-config>