Updated DIV after submit

Marcelo Junior wrote:

I have two DIV`s, one for menu(div "menu"), and other for appear the forms(div "tela").Well, after execute submit of view "new", is load the view of scaffold, in new window. I want that after execute the submit, the view "list" appear in my div "tela".

I am beginning to suspect that a Rails Ajax project should prefer "render :update" over :update => 'id'. That means instead of the View RHTML containing...

remote_something :update=>'my_div', ...

we should prefer a controller action responding with:

render :update do |rjs| # some call that |page|    rjs.replace_html 'my_div', my_new_html end

So you might be able to do this:

render :update do |rjs|    rjs.replace_html 'my_div', my_new_html    rjs.replace_html 'my_list', my_new_list end

Now the question arises how to extract my_new_html and my_new_list from scaffold-land.

And note that scaffolds should never be treated as production code (just as real-life scaffolds should never be treated as real buildings). You should learn from them, then write your own controllers and views.

Also note that you can update anything with contents, not just a DIV...

Marcelo Junior wrote:

I make this render in controller, what make this?

I can't understand your question. Copy a little of your code into your post and ask again, a different way.