Sha256: bca3b741e78dd37aea912a7102830968783c05e896d7d661584a505c26506aa2
Contents?: true
Size: 995 Bytes
Versions: 172
Compression:
Stored size: 995 Bytes
Contents
module WithStudentPathNavigation class Navigation def initialize(template) @template = template end def button(navigable) sibling = sibling_for(navigable) link_to link_icon(sibling), sibling, merge_confirmation_classes(navigable, class: clazz) if sibling && sibling != navigable end def link_icon(sibling) fa_icon(icon, text: I18n.t(key, sibling: sibling.name, kind: I18n.t(sibling.class.model_name.name.downcase)), right: right) end def right false end def merge_confirmation_classes(navigable, base_classes) if navigable.is_a? Reading base_classes.merge class: "btn-confirmation #{base_classes[:class]}", 'data-confirmation-url': exercise_confirmations_path(navigable) else base_classes end .merge role: "button" end def method_missing(name, *args, &block) @template.send(name, *args, &block) end end end
Version data entries
172 entries across 172 versions & 1 rubygems