How to access helper methods outside of the view layer?
# models/category.rbdef description "This category has #{helpers.pluralize(products.count, 'product')}."enddef helpers ActionController::Base.helpersend# products_controller.rbdef create @product = Product.new(params[:product]) if @product.save flash[:notice] = "Successfully created #{@template.link_to('product', @product)}." redirect_to products_url else render :action => 'new' endend |