Hi all,
I want to use a link and render a partial in the view i have got the
following code on the net its not giving any error but i am unable to
get the required result on page can anyone clarity my problem; give me
proper syntax to update div using link with partial…Thanks in advance
for the same…
<%= link_to_remote("Update_div",
:update => ‘idToReplace’,
:url => { :partial => ‘login_user’}) %>
this is the div
Regards,
Kiran
Hola,
<%= link_to_remote("Update_div", :update => 'idToReplace',
:url => { :partial => ‘login_user’}) %>
this is the div
Desde un link sólo tienes dos opciones, o invocas a una función de
javascript cliente, o haces una llamada http (por AJAX o no). En el caso
de un link_to_remote, siempre estás haciendo una llamada http, y en
Rails (y en MVC en general) una llamada HTTP mapea a una acción, por lo
que para pintar el partial necesitas una acción que haga el render.
<%= link_to_remote("Update_div", :update => 'idToReplace',
:url => { :controller=> ‘user’, :action=>‘login’}) %>
this is the div
Y en tu controller
def login
return unless request.xhr?
render :partial => ‘user_login’
end
saludos,
javier ramírez
p.s. the list you sent your mail to is the Rails list in Spanish. You
would probably get more -an undoubtedly better- answers if you use the
language of the list. Anyway, even if you miss the explanation, the
code above should put you on the right track
javier ramirez wrote:
Hola,
<%= link_to_remote("Update_div", :update => 'idToReplace',
:url => { :partial => ‘login_user’}) %>
this is the div
Desde un link s�lo tienes dos opciones, o invocas a una funci�n de
javascript cliente, o haces una llamada http (por AJAX o no). En el caso
Hola,
las gracias por su contestación sino mà no son tan más familier con
español si usted contesta la misma cosa en inglés yo es agradecido a
usted
respetos,
kiran
Kiran P. wrote:
javier ramirez wrote:
Hola,
<%= link_to_remote("Update_div", :update => 'idToReplace',
:url => { :partial => ‘login_user’}) %>
this is the div
Desde un link s�lo tienes dos opciones, o invocas a una funci�n de
javascript cliente, o haces una llamada http (por AJAX o no). En el caso
Actually for implementation of this thing i have used a javascript
function and made and ajax request to call and action from controller
which renders appropriate partial; but i want to do it with
link_to_function or link_to_remote how to do that plz answer in english
i will thankful to you hv a nice time
regards,
kiran