Module: NotesHelper

Defined in:
app/helpers/notes_helper.rb

Instance Method Summary collapse

Instance Method Details



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

def link_to_delete_note(note, descriptor = sanitize(note.id.to_s))
  link_to(
    descriptor,
    note_path(note, :format => 'js'),
    {:id => "delete_note_#{note.id}", :class => "delete_note_button",
      :title => t('notes.delete_note_title', :id => note.id), :x_confirm_message => t('notes.delete_note_confirm', :id => note.id)}
  )
end

#rendered_note(note) ⇒ Object



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

def rendered_note(note)
  Tracks::Utils.render_text(note.body)
end

#truncated_note(note, characters = 50) ⇒ Object



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

def truncated_note(note, characters = 50)
  Tracks::Utils.render_text(truncate(note.body, :length => characters, :omission => "..."))
end