view
<div id="chart">
<%= render :partial => "users/blood",:locals => {:blood_pressure_chart =>@blood_pressure_chart} %>
</div>
<%= link_to("/users/adjust_month_chart/#{@user.id}&blood_pressure?act=2014-09") do %>
下个月
<% end %>
controller
def adjust_month_chart
......
respond_to do |format|
format.html { redirect_to 'show' }
format.js {render "up_chart"}
end
end
up_chart.js.erb
$("#chart").html("<%= j render :partial => 'users/blood',:locals => {:blood_pressure_chart => @blood_pressure_chart} %>");
注:我是通过一个 link 来调用 controller 一个方法进行局部刷新操作,方法是调用到啦,但是 up_chart 文件没有进去。 大神,请教教我把!