How do I send data to a Rails controller from Flex?
I am trying to use an HTTPService to send a string of text to a controller action. How do I access i开发者_运维问答t within the controller? Thanks.
Any parameters you send should be accessible from the params hash in the controller. For example, if I pass a Rails application the URL:
http://localhost:3000/articles/search?q=articles
I will be able to access the value like this:
#in articles_controller.rb
def search
query = params[:q]
end
An easy way to integrate Flex with Rails is to use RubyAMF ( http://code.google.com/p/rubyamf/ ).
精彩评论