0
如何在视图图层中提供以下方法?公开控制器的类方法来查看辅助方法?
# app/controllers/base_jobs_controller.rb
class BaseJobsController < ApplicationController
def self.filter_name
(controller_name.singularize + "_filter").to_sym
end
end
我想在这样的视图助手来使用它:
module ApplicationHelper
def filter_link(text, options = {})
# Need access to filter_name in here....
end
end