When I go to http://localhost:3000/hello/sayhello, Rails outputs:
hello world!
as HTML.
But when I run this Flex remote "Hello World" app, I see a button and a textbox but it does not pick up the output of the HTTPService call to my Rails url. Any ideas why?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
backgroundGradientColors="[#ffffff, #c0c0c0]"
width="100%"
height="100%">
<mx:HTTPService
id="helloSvc"
url="http://localhost:3000/hello/sayhello"
method="POST" resultFormat="text"/>
<mx:Button label="call hello service"
click="helloSvc.send()"/>
<mx:TextInput text="{helloSvc.lastResult}"/>
</mx:Application>
I copied and pasted your code into a new Flex App, modifying the URL to point to a script I know works with Flex apps, and it worked just fine.
I also changed my server-side script to print 'hello world' with a newline, and that worked fine as well.
Your Flex code appears to be working OK with plain-text, but something is obviously not connecting between the data display and the data itself. I'm not experienced with Rails, but I wonder if your server is outputting data which cannot be parsed, and any exceptions are getting swallowed.
Here's my suggestion: change your 'sayhello' script so it simply prints a content-header and 'hello world' -- all in plain-text. Make sure it outputs in the browser, and then see if it also works in the Flex app. If it does, your Rails app is probably outputting content which needs to be parsed, as opposed to simply set to the text input. If it doesn't, you'll need to do more debugging.
BTW, I tried this with both plain-text output and XML output. In both attempts, I was able to view the content in the text-input field.