Passing @object into a rails partial render

前端 未结 5 879
后悔当初
后悔当初 2020-12-31 01:41

I have a partial:

\'profiles/_show.html.erb\'

that contains code like

<%= @profile.fullname %>

I\'m trying to render

5条回答
  •  醉话见心
    2020-12-31 02:01

    this is more simple

    <%= render :partial => "profiles/show", :collection => @profiles %>
    

    on partial _show.html.erb

    <%= profile.fullname %>
    

    hope helped

提交回复
热议问题