alais
1
This is really easy and simple but…
I have
view <%=link_to_remote ‘this’, {:url=>{:action=>‘action’}, :with =>
“‘name=’ + $(‘text_field_id’).value” } %>
When I’m in the controller, how do I access the variable ‘name’? I
thought it was params[:name] but that returns nil…
Thanks
alais
2
On Mon, 2008-05-26 at 06:32 +0200, s. \ wrote:
This is really easy and simple but…
I have
view <%=link_to_remote ‘this’, {:url=>{:action=>‘action’}, :with =>
“‘name=’ + $(‘text_field_id’).value” } %>
When I’m in the controller, how do I access the variable ‘name’? I
thought it was params[:name] but that returns nil…
look in your logs (presumably log/development.log) to see what it was
that was posted back to your controller.
Craig
alais
3
On 26 May 2008, at 06:05, Craig W. wrote:
look in your logs (presumably log/development.log) to see what it was
that was posted back to your controller.
In particular that will screw up if your text field contains an
ampersand. You should use encodeURIComponent to guard against that.
Fred