的情况下输出sinatra中的变量在存在用于erb remplates的<%%块内部存在用于输出变量的“concat”之类的帮助器。我可以在Sinatra中使用哪个帮手执行相同的操作,而不使用<%=%>块?我的意思是,像 <%
#code
concat "This should be rendered in HTML, not in console"
#code
%>
编辑 视图中的代
我正在做一个简单的查询到数据库表发送到外部服务,但我需要添加一个元素到每个返回的记录之前,我这样做。 app.rb get "/:task/:account_id/contacts" do
@contacts = Contact.where("Account = ?", params[:account_id])
@contacts.to_json
end
提供我,我需要