I think I'm missing something somewhere.
I had the renderer working for some time with the original text area (content) and have now added a new column to the model (body). I have added everything and the form works, the views show the body input but markdown won't render.
So this is my application helper:
def markdown(content)
@markdown ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, space_after_headers: true, fenced_code_blocks: true)
@markdown.render(content)
end
def markdown(body)
@markdown ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, space_after_headers: true, fenced_code_blocks: true)
@markdown.render(body)
end
def title(page_title)
content_for :title, page_title.to_s
end
And my show view:
=title @portfolio.title
.container.pushdown.img-responsive
.row
.col-md-2
%br
%p= link_to 'Back', portfolios_path
.col-md-8
%h2
= @portfolio.title
%p
=markdown(@portfolio.body).html_safe
%p
=markdown(@portfolio.content).html_safe
%br
%br
And I get the following error:
wrong argument type nil (expected String)