如何在控制器上连接HAML模板?
我在API模式下使用Rails7,我想在我的应用程序上返回一个HTML模板
P.D:我之所以包括ActionController::Base,是因为FullStack模式下的Rails使用ActionController::Base来返回HTML模板
# app/views/tickets/ticket.html.haml
%strong= Hello World
# app/controllers/tickets_controller.rb
class TicketsController < ActionController::Base
def index
# (return HAML template here)
end
end
1条答案
按热度按时间lmyy7pcs1#
我来解决问题!只要我这么做:
只是我把它作为一个HTML模板几乎像全栈模式