Friday, 6 September 2013

Use of ajax to get new data in views , rails

Use of ajax to get new data in views , rails

I am working on Ruby on rails app , basically this is my view
<%= @h %>
// some changes to @h which is n total_span
jQuery.ajax({
data: 'val=' + total_span,
dataType: 'script',
type: 'post',
url: "/portfolio/slide_change"
});
Slide_change is this:
j=params[:val]
g=TargetPortfolio.new
@h=g.finding_the_concerned_id(j)
render "target_port"
target_port -name of view file.
I am not getting the refreshed value of @h , any guesses where i am wrong.
But in my page i am not getting the refreshed value of @h ,

No comments:

Post a Comment