Forum: Ruby on Rails form_remote_tag params not passed .. PLEASE help!

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
68329ed284a225cfcdc523480ab3a889?d=identicon&s=25 rubynewbie (Guest)
on 2006-02-23 22:21
This problem is driving me nuts

Here is my code for the view:

<div class="signW">
<div class="sign">
coming soon! <br/>
<div class="stxt">
Email address:
</div>
<div id="result">
</div>
<%= form_remote_tag(:update => 'result',
                        :url => { :controller => 'launch', :action =>
'process_email' },
                        :with => "'blah=' + escape(value)",
                        :complete =>
"Element.hide('eid');Element.hide('sub');Element.show('result')",
                        :position => "top") %>
        <input type="text" id="eid" name="blah" value="" />
        <input type="submit" id="sub" name="commit" value="Sign Up"/>
<%= end_form_tag %>

Here is my controller code:

class LaunchController < ApplicationController
        layout "launch-layout"
       def index
       end
       def process_email
                render_text @params.inspect
       end
end

It only prints out {"action"=>"process_email", "controller"=>"launch"}

The parameters DONT SHOW UP!!!

I have <%= javascript_include_tag "prototype" %> in my layout.

where am I screwing up????


PLEASE HELP!
68329ed284a225cfcdc523480ab3a889?d=identicon&s=25 rubynewbie (Guest)
on 2006-02-23 22:28
what is even more scary is the production.log generates the following

Processing LaunchController#process_email (for x.u.x.h at 2006-02-23
16:26:50) [GET]
  Parameters: {"action"=>"process_email", "controller"=>"launch"}
Response body was encoded with gzip
Completed in 0.00327 (305 reqs/sec) | 200 OK

Doesnt show the parameters! is something wrong with my view code??
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2006-02-23 23:20
(Received via mailing list)
rubynewbie wrote:

> =====
> It only prints out {"action"=>"process_email", "controller"=>"launch"}
>
> The parameters DONT SHOW UP!!!

You probably want

                :with => "'blah=' + escape($F('blah'))",

or remove the :with option and escape at the server.

--
We develop, watch us RoR, in numbers too big to ignore.
68329ed284a225cfcdc523480ab3a889?d=identicon&s=25 rubynewbie (Guest)
on 2006-02-24 00:24
Mark Reginald James wrote:
> rubynewbie wrote:
>
>> =====
>> It only prints out {"action"=>"process_email", "controller"=>"launch"}
>>
>> The parameters DONT SHOW UP!!!
>
> You probably want
>
>                 :with => "'blah=' + escape($F('blah'))",
>
> or remove the :with option and escape at the server.
>
> --
> We develop, watch us RoR, in numbers too big to ignore.

:with was added to see if the parameter would be passed .. The problem
is this requested should be generating a POST on the server its
generating a GET! Weird!
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2006-02-24 00:45
(Received via mailing list)
rubynewbie wrote:

> :with was added to see if the parameter would be passed .. The problem
> is this requested should be generating a POST on the server its
> generating a GET! Weird!

Ah, OK.  Look at the source of the generated HTML to make sure prototype
is being included.


--
We develop, watch us RoR, in numbers too big to ignore.
This topic is locked and can not be replied to.