Note that there are some explanatory texts on larger screens.

plurals
  1. PONoob filter: How do I refer to a string that is passed to my Ruby on Rails method from Flex as a HTTPService?
    text
    copied!<p>EDIT:</p> <p>Got too confusing with so many different edits, so this is where I'm currently at.</p> <p>I have a HTTPService in my Flex 4 app defined as follows:</p> <pre><code>&lt;s:HTTPService id="getUserDetails" url="http://localhost:3000/users/getDetails" method="GET"/&gt; </code></pre> <p>I call this service like this (note: I've checked the network monitor in Flash Builder 4 and the userNameLookup variable is sent correctly):</p> <pre><code>var userNameLookup:String; userNameLookup = calleeInput.text; getUserDetails.send(userNameLookup); </code></pre> <p>And finally, this is the Ruby on Rails method:</p> <pre><code>def getDetails @user = User.find_by_username(:userNameLookup) render :xml =&gt; @user end </code></pre> <p>This is the error message in the log:</p> <blockquote> <p>Processing UsersController#getDetails (for 127.0.0.1 at 2010-04-27 19:24:23) [GET] User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = '--- :userNameLookup ') LIMIT 1</p> <p>ActionView::MissingTemplate (Missing template users/getDetails.erb in view path app/views):<br> app/controllers/users_controller.rb:33:in <code>getDetails'<br> app/controllers/users_controller.rb:32:in </code>getDetails'<br> /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in <code>service'<br> /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in </code>run'<br> /usr/local/lib/ruby/1.8/webrick/server.rb:173:in <code>start_thread'<br> /usr/local/lib/ruby/1.8/webrick/server.rb:162:in </code>start'<br> /usr/local/lib/ruby/1.8/webrick/server.rb:162:in <code>start_thread'<br> /usr/local/lib/ruby/1.8/webrick/server.rb:95:in </code>start'<br> /usr/local/lib/ruby/1.8/webrick/server.rb:92:in <code>each'<br> /usr/local/lib/ruby/1.8/webrick/server.rb:92:in </code>start'<br> /usr/local/lib/ruby/1.8/webrick/server.rb:23:in <code>start'<br> /usr/local/lib/ruby/1.8/webrick/server.rb:82:in </code>start'</p> </blockquote> <p>So it appears that the userNameLookup parameter isn't being referred to correctly? Just a thought, but does it matter that I've set the HTTPService to GET even though it is posting something?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload