The anchor doesn't work with method: :post for some reason.
My view file index.haml:
/ some code here
%h3= Description
.results
=render 'result_box'
_result_box.haml partial:
.row#scroll-here
.col-md-12
= link_to "Get result", get_result_path(@book, :anchor => "scroll-here", parameters: {first: 1, second: 2}), method: :post, remote: true
index.js.erb :
$('.results').html("<%= j (render partial: 'result_box') %>")
After pressing link_to and reloading ".results" the page focus is still on the top of the page. But I want it to be at the "#scroll-here".
try this
or
Refer this link (http://haml.info/docs/yardoc/file.REFERENCE.html#inserting_ruby_)