Skip to content
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.

Partial replacement with div content not working #644

Open
anuj-dhanju opened this issue Dec 16, 2015 · 2 comments
Open

Partial replacement with div content not working #644

anuj-dhanju opened this issue Dec 16, 2015 · 2 comments

Comments

@anuj-dhanju
Copy link

I have tried with both way "Client-side partial replacement", "Server-side partial replacement" but its not working. Its render the page but not replacing the div content.
Gemfile:
gem 'turbolinks', :github => 'rails/turbolinks', :branch => 'master'

My code is..
def test
render :test, change: ['tabs']
end

view index.html.slim
= link_to "render test in tabs", test_users_path

tabs.tab-pane

Expected :
When I will click on "render test in tabs" link, test action partial should be render in "#tabs".

@caike
Copy link

caike commented Jan 5, 2016

It took me some time to understand this as well. Here's how you can make it work:
First, change your link to use xhr, like:

= link_to "render test in tabs", test_users_path, remote: true

Then, make sure your test view template also has a div with id tabs.
That should be all!

@a-barbieri
Copy link

The documentation is not so explicit and I cannot make @caike suggestion to work.
I'm having hard time as well understanding how this works.

Did you find a way to sort that out?
Is there any hope or should I just drop it?
I just want to load content asynchronously but maybe it's not the right tool.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants