【发布时间】:2012-03-01 02:46:07
【问题描述】:
我有两个模型:
User
has_many :prices
Price
belongs_to :users
我想显示这样的视图:
<% show this view if price belongs to current user %>
<div> Price of Current User </div>
<% end %>
我该怎么做?
【问题讨论】:
-
我不确定我是否理解你的问题,但
<%= current_user.prices %>不会覆盖你吗? -
@shuriu 我改变了我的问题以使其更有意义。
标签: ruby-on-rails ruby ruby-on-rails-3 ruby-on-rails-3.1 devise