views: add tab_item and active_tab_item helpers

This commit is contained in:
Pierre de La Morinerie 2018-08-16 14:30:55 +00:00
parent 6b9d36fbfd
commit 2e762e268e
10 changed files with 96 additions and 84 deletions

View file

@ -0,0 +1,15 @@
module TabsHelper
def tab_item(label, url, active: false, badge: nil, notification: false)
render partial: 'shared/tab_item', locals: {
label: label,
url: url,
active: active,
badge: badge,
notification: notification
}
end
def active_tab_item(label, url, badge: nil, notification: false)
tab_item(label, url, active: current_page?(url), badge: badge, notification: notification)
end
end