you really don''t want to mix your rendering like that. and there is no
need to use :update => ''mypropForm'' in the ajax call in
your view, as
you are doing a page.replace_html.
you''re making an ajax request, so instead of redirec_to, you should do
render :update do |page|
if @proposal.save
page.redirect_to ...
else
page.replace_html ''mypropForm'', :partial =>
''myprop_form''
end
end
On 2/8/07, Kad Kerforn
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> This action is called via an Ajax request... with a parameter :update
> ''mypropForm''
> def modify_prop
> @ proposal = Proposal.find_by_id(params[:id])
> # modify the proposal attribute.....
> .....
> # if saved then redirect to proposal list
> redirect_to(:action => "list_ proposal", :id =>
current_user ) and
> return if @ proposal.save
> # if error : redisplay proposal with errors
> render :update do |page|
> page.replace_html ''mypropForm'', :partial =>
''myprop_form''
> end
> end
>
> when saved, the redirect is performed... but the llist_ proposal action
> doesn''t render the full layout as it should.... it just render
the
> partial ! even if the redirect_to request is not an xml_http_request
> ....
>
> why this :update parameter is still used anyway to get rid of it in the
> redirect ?
>
> thanks to Ajaxian gurus
>
> kad
>
> --
> 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
-~----------~----~----~----~------~----~------~--~---