Hello there,
I''m trying to do something like:
render :update do |page|
page[:client_list].replace_html render(:partial =>
''client_list'',
:object => @clients_list)
name = page[:name].getValue();
end
but I''m not getting the value, or somehow use
$("name").getValue()
inside of the controller.
How can I do that?
tks,
David Sousa
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Mark Reginald James
2009-Jan-23 09:46 UTC
Re: getValue() in a Controller problem, help please.
David Sousa wrote:> Hello there, > > I''m trying to do something like: > > render :update do |page| > page[:client_list].replace_html render(:partial => ''client_list'', > :object => @clients_list) > name = page[:name].getValue(); > end > > but I''m not getting the value, or somehow use $("name").getValue() > inside of the controller.You will need to send this value as a parameter of your AJAX call, using the :with parameter of the form helper. -- Rails Wheels - Find Plugins, List & Sell Plugins - http://railswheels.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hello Mark, thanks... but, my problem is bigger than that or I don''t
know how that the answer is easy.
So, I have a structure like this. (view)
<div id="my_client_list">
<% @client_list.each do |client| -%>
<%= client.name%>
....... .. .. .. ..
<% end -%>
<%=will_paginate(@client_list, :params => {:controller =>
"client",
:action => "search_result", :foo =>
"$F(''name'')"})%>
</div>
<div id="search_form_div">
<form class="sidebar-search-companies" id=
''search_form''>
<label for="nome">Nome</label>
<%= text_field_tag :name%>
.... .... ...
</form>
<%= observe_form :search_form, :frequency => 0.5, :url => { :action
=> "search_result" } %>
</div>
What I wanna do is, pass the :name.value of the search form to the
paginate action, so when the result is paginated I will still have the
same results. Otherwise, when I go the the second page for example, I
will have the second page of all my clients, not the result of the
search.
Sounds confusing... did you understand?
Tks,
David Sousa
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Mark Reginald James
2009-Jan-25 03:53 UTC
Re: getValue() in a Controller problem, help please.
David Sousa wrote:> Hello Mark, thanks... but, my problem is bigger than that or I don''t > know how that the answer is easy. > > So, I have a structure like this. (view) > > <div id="my_client_list"> > <% @client_list.each do |client| -%> > <%= client.name%> > ....... .. .. .. .. > <% end -%> > <%=will_paginate(@client_list, :params => {:controller => "client", > :action => "search_result", :foo => "$F(''name'')"})%> > </div> > > <div id="search_form_div"> > <form class="sidebar-search-companies" id= ''search_form''> > <label for="nome">Nome</label> > <%= text_field_tag :name%> > .... .... ... > </form> > <%= observe_form :search_form, :frequency => 0.5, :url => { :action > => "search_result" } %> > </div> > > > What I wanna do is, pass the :name.value of the search form to the > paginate action, so when the result is paginated I will still have the > same results. Otherwise, when I go the the second page for example, I > will have the second page of all my clients, not the result of the > search.Since you''re using observe_form, params[:name] will be set in your controller action, which can be used in the view. e.g. :foo => params[:name] -- Rails Wheels - Find Plugins, List & Sell Plugins - http://railswheels.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hello Mark James, thank you very much, it worked, and was easy... lol. I''m getting used to rails.... tks, David Sousa -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---