Hello,
I've got a little problem with remote functions. I call it for example
like this: <%= link_to_remote 'bla', :url => 'bla/whatever', :method =>
:get %>
that function would be:
def whatever
flash[:notice] = "You're in whatever!"
update_content
end
since I don't want the page to be reloaded completely, I update each div
box that needs to be updated:
def update_content
render :update do |page|
page.replace 'loginBox', :partial => 'shared/login'
page.replace 'contentBox', :partial => 'shared/content'
page.replace 'navigation', :partial => 'shared/navigation'
page.replace 'menuBox', :partial => 'shared/menu'
end
end
My problem nos is that the partial views/shared/_content.html.erb has a
yield which doesn't show me the content of views/bla/whatever.html.erb
anymore and only shows it when I access it directly (not using remote
functions).
Does anyone know how I possibly could still show the content of the
template of each action where yield is?
My other approach was:
<%= link_to_remote 'bla', :url => 'bla/whatever', :update =>
'contentBox', :method => :get %>
def whatever
flash[:notice] = "You're in whatever!"
respond_to do |format|
format.html
format.xml { head :ok }
end
end
That would show the template as I want it but doesn't update login,
navigation and menuBox.
Any ideas? I'm kind out of ideas... :(
--
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---