2010-04-28 6 views

Répondre

1

Vous devez ajouter une méthode javascript à votre page et appeler à partir de votre controleur

Ex: - Dans votre example.html.erb

function scrollToDiv(id){ 
    // This method is used to scroll page 
} 

Et dans votre méthode de commande

page.insert_html :bottom, :comments, :partial => 'comment', :object => @comment 
page << "scrollToDiv('#{@comment.id}')" 
Questions connexes