残念ながら、これはターボリンクでは不可能であり、pjax 自体でも不可能です (いわゆる pjax コンテナーを複数持つため)。
Turbolinks は常に body 要素全体のコンテンツを置き換えます。Pjax は常に要素の内容をpjax-container
data 属性に置き換えます。
もちろんやり方はあります。クライアント側の JavaScript フレームワークを捨てることで、ajax リクエストを実行してjs
レスポンスを返すことができます。
私の頭の上から、次のようなビューを表示できます。
index.html.erb
<%= link_to 'Show', show_path, remote: true %>
コントローラ
def show
# Do the work, fetch data from database etc.
# Keeping both formats ensures that when you hit the url directly
# the whole page gets rendered as usual (show.html.erb),
# when the request is an ajax request using the view snipper above just
# the javascript for replacing the content of a single panel is rendered (show.js.erb)
#
# Rails is smart enough so it should not be required to include the respond_to block
# in the controller, Rails automagically chooses an appropriate response format
# based on the request, you only need to have the views in place,
# but I keep it here so you get a picture.
respond_to do |format|
format.html
format.js
end
show.js.erb
$('.right-panel').html('<%= j render partial: "something" %>')