0
之前,我只是用RJS這是真棒但是我習慣把在link_to_remote和這樣的視覺效果開始,我不知道如何之前和遙控器被觸發之後觸發動作。添加視覺效果呈現的行動
拿這個鏈接,例如:
HTML
<span id="<%= "edit_comment_link_#{comment.id.to_s}"%>" style="float:left;">
<%= link_to_remote "edit", {:update => "comment_#{comment.id.to_s}", :url => edit_post_comment_path(comment.post, comment), :method => :get}%> | </span>
控制器:
def edit
@comment = Comment.find(params[:id])
respond_to do |format|
#format.html render edit_comment_path(@comment)
format.js
end
end
RJS:
page.replace_html "edit_comment_link_#{@comment.id.to_s}", "currently editing | "
所以是RJS主要是針對後動作呈現視覺效果如此S A微調應放在與call_backs
的link_to_remote?這是做事的好方法嗎?