I have a form on my page that is popup-like but actually part of the
page. it works fine as I used in other page. In order to close it after
submission. I do something like
respond_to do|wants|
wants.js do
render :update do |page|
page << "jq('#message_title, #message_body').val('');"
page << "tb_remove()"
end
end
end
As requirements change I was to update another DIV with listing so I
would like to do something like
render :partial => 'client_listing', :locals => {:listing_clients =>
@listing_clients}
I need to do both together but I can as you can only render once per
method with Rails:
actionController::DoubleRenderError in SmsController#add_client
Can only render or redirect once per action
Any ideas how I can approach this issue as I need to perform both
actions?
I have a form on my page that is popup-like but actually part of the
page. it works fine as I used in other page. In order to close it after
submission. I do something like
respond_to do|wants|
wants.js do
render :update do |page|
page << "jq('#message_title, #message_body').val('');"
page << "tb_remove()"
end
end
end
As requirements change I was to update another DIV with listing so I
would like to do something like
render :partial => 'client_listing', :locals => {:listing_clients =>
@listing_clients}
I need to do both together but I can as you can only render once per
method with Rails:
actionController::DoubleRenderError in SmsController#add_client
Can only render or redirect once per action
Any ideas how I can approach this issue as I need to perform both
actions?
If I understand you correctly, you can accomplish what you're trying to
do by using the RJS replace_html method within the render :update.
Assuming there's an element already on the page within which you'd like
to render the partial above...