Ajax form for-how to refresh the <div> without any layout?

hi,

I got an ajax form that can post values to controller to create
item.(simply an form_remote_for )then redirect to another page.

however, the response is include the app/view/layout/application.rthml.
so my refresh

nested into another page.

is that any better way to doing this?

Ghee wooi Ong wrote:

hi,

I got an ajax form that can post values to controller to create
item.(simply an form_remote_for )then redirect to another page.

however, the response is include the app/view/layout/application.rthml.
so my refresh

nested into another page.

is that any better way to doing this?

Hi,
I did’n get you. Anyway In order to refresh a particular div I uasually
use :update =>“divname”

my code look like this:

<% form_remote_for :location, :update=>‘content’, :url => ‘/create’,
:html=>{:id =>‘location’} do |f| %>

<% end %>

I had a

content
in my page, so it will be replace my the ajax
response.
but the only thing is it include the layout which I don’t want.

is that any way to discard the layout?

ok thx !

Ghee wooi Ong wrote:

my code look like this:

<% form_remote_for :location, :update=>‘content’, :url => ‘/create’,
:html=>{:id =>‘location’} do |f| %>

<% end %>

I had a

content
in my page, so it will be replace my the ajax
response.
but the only thing is it include the layout which I don’t want.

is that any way to discard the layout?

In the controller when you can give like
render_without_layout : “view file name”
this will help I hope