I use the rails 3.0.0.beta
Is there any new syntax to write RJS, here is an example
def remote_create
@photo = Photo.new(params[:photo])
respond_to do |format|
if @photo.save
# add @photo's thumbnail to last import tag
format.js {
render :update do |page|
page.insert_html :bottom, 'polaroids' , :partial => 'polaroid', :locals => {:photo => @photo}
end
}
else
#...
end
end
end
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…