我试图通过一个URL到后台进程,以便它可以发布它在Facebook /鸣叫它。替代url_for ActionController :: Base
class Weeklychecks < ActionController::Base
.
.
.
def self.verifications
.
.
.
@my_url = url_for(:action => 'show', :controller => 'profiles', :only_path => false)
.
end
end
但似乎这个代码弃用:http://apidock.com/rails/ActionController/Base/url_for
我用这个方法时,基类是ApplicationController的,但我需要使用的ActionController :: Base的在这一个。我试图添加 包括ActionView :: Helpers :: UrlHelper 但它也不起作用。有没有解决这个问题的方法?
我运行的Rails 3.2.3
感谢
工作,谢谢! – MrJacket
你在哪里可以找到像link_to这样的其他助手? – hcarreras