I created a method in app/helpers/logs_helper.rb
:
def product_name(id)
Product.find_by_id(id).name
end
I want to use this product_name
in app/helpers/logs_helper/products_log_helper.rb
:
module LogsHelper
module ProductsLogHelper
def search(params)
product_log_name = product_name(params[:id])
end
end
end
But it can't find product_name
even I use:
include LogsHelper
in the products_log_helper.rb
file.
How to do this? I am using Rails 3.2