You defined your markdown method to receive one parameter called text
. But what you provide in your views is a block.
To make things work, you either change the way you call the markdown
helper method in the view
<%= markdown 'this is some markdown text in here' %>
or you change the markdown helper to accept a block
def markdown
Redcarpet.new(yield).to_html
end
P.S.: The Redcarpet syntax has changed a bit since the Railscast, so if you are using a more recent gem version, implementing it this way won't work.
Starting at least from 3.3.4, perhaps earlier, you have to create a specific renderer and then call render on it with the markdown as an argument, i.e.
def markdown
Redcarpet::Render::XHTML.new.render(yield)
end
Up to date documentation can be found here: https://github.com/vmg/redcarpet