Method: MarkdownRecord::ViewHelpers#link_to_markdown_record
- Defined in:
- app/helpers/markdown_record/view_helpers.rb
#link_to_markdown_record(model, name = nil, html_options = nil, &block) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/helpers/markdown_record/view_helpers.rb', line 3 def link_to_markdown_record(model, name = nil, = nil, &block) return nil if model.nil? path = path_to_markdown_record(model, "") name ||= model.name if model.respond_to?(:name) block_given? ? link_to(path, , nil, &block) : link_to(name, path, , &block) end |