0
如何在特定條件下展示展示動作?有條件展示
def show
@post = Post.find_approved
if @post.approved
approved = true
end
respond_to do |format|
# I only want to render show.html.erb if approved is true if not I would like to redirect the user back to where he came from
end
end
兩個答案很好地工作。謝謝 – badnaam 2010-09-24 01:47:23