Method: MarkdownRecord::ViewHelpers#link_to_markdown_record_html
- Defined in:
- app/helpers/markdown_record/view_helpers.rb
#link_to_markdown_record_html(model, name = nil, html_options = nil, &block) ⇒ Object
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, = 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, , nil, &block) : link_to(name, path, , &block) end |