turbolinks / turbolinks-classic

Classic version of Turbolinks. Now deprecated in favor of Turbolinks 5.
MIT License
3.54k stars 428 forks source link

Allow to pass a url to Turbolinks.replace #649

Open fsauter opened 8 years ago

fsauter commented 8 years ago

Hi, I was just wondering why it is not possible to pass a URL to Turbolinks.replace?

I now have do the following (which is okay but I was expecting that turbolinks is capable of this):

$.get(price_table_invoice_path, function( partial_html ) {
    Turbolinks.replace(partial_html, { change: ['price-table'] });
});

// What I would expect:
Turbolinks.replace(price_table_invoice_path, { change: ['price-table'] });

Turbolinks.visit(invoice_path, { change: ['price-table'] }) would render the whole layout etc. on the server-side which should increase server's workload since I only need to reload/replace a small partial part of the page.