2013-08-01 118 views

回答

0

您可以在視圖中使用這個你想呈現另一種觀點

abc - The name of the folder in which the other view exists (views/abc/view_name.html.erb) 
xyz - The name of the view 

<%= render :template "abc/xyz" %> 
0

你甚至可以用諧音或明確呈現另一個模板在控制器的action.eg: -

def UsersController < ApplicationController 

    def index 
    @records = User.all 
    render '/products/index' # instead of user's index i rendered product's index template 
    end 

end 
相關問題