Make another controllers view a partial (Rails 3)
问题 Have a post with comments. On post/show, when a user clicks the add comment button the server calls a javascript function that should add the new comment action as a partial: render 'comments/new' $("#newcomment").live("click",function() { $("#addcomment").load("<%= url_for :controller => 'comments', :action => 'new', :locals => {:parent_id => @post.parent_id} %>") def new @comment = Comment.new( :parent_id => params[:parent_id] ) render :partial => "form", :layout => false end new view: