我是ruby on rails的新手,这也是我的第一个ruby应用程序。现在我需要在我的应用程序中添加markdown我遵循以下教程
http://crabonature.pl/posts/16-markdown-in-ruby-on-rails
但它显示的错误是:
此处还有我的代码详情
查看文件代码:
<%= form_for upload_resumes_path, method: :post do |f| %>
<div class="col-sm-6">
<div class="form-group">
<label class="title">Job Description</label>
<%= markdown @upload_resumes.job_description %>
</div>
</div>
<% end %>
控制器代码:
def uploadResume
@upload_resumes = current_user
end
Application_helper.rb代码:
module ApplicationHelper
def markdown(text)
render_options = {
filter_html: true,
hard_wrap: true,
link_attributes: { rel: 'nofollow' }
}
renderer = Redcarpet::Render::HTML.new(render_options)
extensions = {
autolink: true,
fenced_code_blocks: true,
lax_spacing: true,
no_intra_emphasis: true,
strikethrough: true,
superscript: true
}
Redcarpet::Markdown.new(renderer, extensions).render(text).html_safe
end
end
宝石文件代码:
gem 'redcarpet'
有人可以帮我找错误的地方
我的rails版本:4.2.5