Module: NotesHelper

Defined in:
app/helpers/notes_helper.rb

Instance Method Summary collapse

Instance Method Details

#note_title_tag(note, opts = {}) ⇒ Object


10
11
12
13
14
15
# File 'app/helpers/notes_helper.rb', line 10

def note_title_tag(note, opts = {})
  opts[:limit] ||= 50
  return '' if note.blank?
  return '' if note.title.blank?
  truncate(note.title.delete('#'), length: opts[:limit])
end

#render_node_name(name, id) ⇒ Object


6
7
8
# File 'app/helpers/notes_helper.rb', line 6

def render_node_name(name, id)
  link_to(name, main_app.node_topics_path(id), class: 'node')
end

#render_node_topics_count(node) ⇒ Object


2
3
4
# File 'app/helpers/notes_helper.rb', line 2

def render_node_topics_count(node)
  node.topics_count
end