Sunday, July 25, 2010

[Rails] render :update with different controller does nothing

Hi!

I want to render 2 different actions - in different controller - when
the user clicks on a button.
I solved this with JS calls (Ajax.Updater) within the view,
but wanted to take the app logic out of the view and into the
controller.
So I created a new controller action, calling the 2 updates from there
like this:

render :update do |page|
page.replace_html 'Browser', :partial => 'browser'
page.replace_html 'DetailView', :url => {:controller => 'place',
:action => 'edit', :id => @selection}
end

Unfortunately, the update of the DetailView does nothing.
The generated JS (for DetailView only) looks like this:

try {
Element.update("DetailView", null);
} catch (e) { alert('RJS error:\n\n' + e.toString());
alert('Element.update(\"DetailView\", null);'); throw e }

So nothing gets rendered.
What can I do?

Thanks!
Chris
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate