Method: MarkdownRecord::ViewHelpers#link_to_markdown_record_html

Defined in:
app/helpers/markdown_record/view_helpers.rb


12
13
14
15
16
17
18
19
# File 'app/helpers/markdown_record/view_helpers.rb', line 12

def link_to_markdown_record_html(model, name = nil, html_options = nil, &block)
  return nil if model.nil?

  path = path_to_markdown_record_html(model)
  name ||= model.name if model.respond_to?(:name)

  block_given? ? link_to(path, html_options, nil, &block) : link_to(name, path, html_options, &block)
end