Ruby on rails 在rabl集合中调用Rails帮助程序

Ruby on rails 在rabl集合中调用Rails帮助程序,ruby-on-rails,ruby,rabl,Ruby On Rails,Ruby,Rabl,我想从rabl模板调用Rails助手方法。我能为一个物体找到它 这是我当前的设置(工作正常) 我有一个助手 #app/helpers/application_helper.rb module ApplicationHelper def full_url(image) "#{request.protocol}#{request.host_with_port}#{image.picture_url}" if recipe.image end end #app/images/s

我想从
rabl
模板调用Rails助手方法。我能为一个物体找到它

这是我当前的设置(工作正常)

我有一个助手

#app/helpers/application_helper.rb
module ApplicationHelper

  def full_url(image)
    "#{request.protocol}#{request.host_with_port}#{image.picture_url}" if recipe.image
  end

end


#app/images/show.rabl
object @image
attributes :id, :picture_url
node(:picture_url) { full_url(@image) }
现在我想对图像对象列表执行此操作,但它不起作用,而且我在
rabl
README中找不到它

问题是它通过了
@images
列表,我不知道如何在每个对象上调用helper方法

#app/images/index.rabl
collection @images
attributes :id, 
node(:picture_url) { full_url(@images) }

可以将参数传递给节点块:

collection @images
attributes :id, :picture_url
node(:picture_url) {|image| full_url(image) }

可以将参数传递给节点块:

collection @images
attributes :id, :picture_url
node(:picture_url) {|image| full_url(image) }

可以将参数传递给节点块:

collection @images
attributes :id, :picture_url
node(:picture_url) {|image| full_url(image) }

可以将参数传递给节点块:

collection @images
attributes :id, :picture_url
node(:picture_url) {|image| full_url(image) }

什么是
完整url
?应该是
thumb\u url
?@BroiSatse,对不起。。我的错,它应该是
完整的url
,我在简化我的代码,结果被打错了。我更新了我的问题。什么是
完整的\u url
?应该是
thumb\u url
?@BroiSatse,对不起。。我的错,它应该是
完整的url
,我在简化我的代码,结果被打错了。我更新了我的问题。什么是
完整的\u url
?应该是
thumb\u url
?@BroiSatse,对不起。。我的错,它应该是
完整的url
,我在简化我的代码,结果被打错了。我更新了我的问题。什么是
完整的\u url
?应该是
thumb\u url
?@BroiSatse,对不起。。我的错,它应该是
完整的url
,我在简化我的代码,结果被打错了。我更新了我的问题。