class HellosController < ApplicationController
def index
#do sth here
end
def new
#do sth here
end
def edit
#do sth here
end
def report
#how can I display different format of report according to diff value of a variable ?
end
end
我知道在控制器的每个不同的功能,可以有一个观点,现在我有这个报告链接到一个报告view.I需要补充报告的观点为这个项目。Ruby on Rails的控制器中的一个功能有不同的看法
如何根据变量显示不同的视图say @reportType? 我需要添加到控制器中?我应该如何命名添加的报告视图?
谢谢!你能解释一下吗?我的报告没有任何链接,在我看来它叫做report.html.erb - 我认为它们是通过名字转换链接的。如何将这个名称链接改为你的方法?以及第二个报告视图在哪里添加以及如何命名? – Orz 2014-10-09 09:12:58
你打算如何报告页面,通过点击一些链接的权利? – RSB 2014-10-09 09:13:56
我已经把问题报告的内容,似乎没有链接那里...在应用程序中,当我点击一个按钮称为报告,报告页面将显示 – Orz 2014-10-09 09:18:27