Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不想为每个资源设置默认格式,而是一次性为所有资源设置它。这可能吗?
在您的 中设置默认格式ApplicationController,所有其余的控制器都应该继承。
ApplicationController
#ApplicationController before_filter :set_format def set_format request.format = 'xml' end