render

 

render :partial => 'articles/article', :locals => { :article => @article }

 

更简单的实现:

 

 

# Render the 'article' partial with an article local variable
render 'articles/article', :article => @article

# Or even better (same as above)
render @article

# And for collections, same as:
# render :partial => 'articles/article', :collection => @articles
render @articles

你可能感兴趣的:(r)