1.相应浏览器
render :nothing => true 空响应到浏览器
render :edit (或render :action => “edit”) 响应edit action,从而返回edit.html.erb页面
render ‘products/show’ (或render :template => ‘products/show’) 响应另一个controller中的action
render “/u/apps/warehouse_app/current/app/views/products/show” (或render :file =>
“/u/apps/warehouse_app/current/app/views/products/show”) 响应application以外的views
render :inline =>
“<% products.each do |p| %>
<%= p.name %>
<% end %>” 没有对应页面的,响应内容给浏览器
render :inline =>
“xml.p {‘Horrid coding practice!’}”, :type => :builder
render :update do |page|
page.replace_html ‘warning’, “Invalid options supplied”
end
render :text => “OK”
render :json => @product
render :xml => @product
render :js => “alert(‘Hello Rails’);”
render :file => filename, :content_type => ‘application/rss’
render :layout => ‘special_layout’
render :layout => false
render :status => 500
render :status => :forbidden
render :xml => photo, :location => photo_url(photo)