I am using a presenter for a view in rails to display data which is saved in a yml file. (i18n gem)
This is the controller-
class DocumentsController < ApplicationController
def index
@presenter = DocumentPresenter.new
end
end
This is my view-
= @presenter.viewname
and this is my presenter-
class DocumentPresenter
def viewname
content_for :secondary_nav_title do
t('Documents')
end
end
end
The error says:
undefined method `content_for'
Why doesn't rails recognize content_for
in the presenter?