tracks/app/helpers/notes_helper.rb

19 lines
574 B
Ruby
Raw Normal View History

module NotesHelper
def truncated_note(note, characters = 50)
render_text(truncate(note.body, :length => characters, :omission => "..."))
end
def rendered_note(note)
render_text(note.body)
end
def link_to_delete_note(note, descriptor = sanitize(note.id.to_s))
link_to(
descriptor,
note_path(note, :format => 'js'),
2020-10-27 21:39:19 +02:00
{ :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
end