views: add tab_item
and active_tab_item
helpers
This commit is contained in:
parent
6b9d36fbfd
commit
2e762e268e
10 changed files with 96 additions and 84 deletions
15
app/helpers/tabs_helper.rb
Normal file
15
app/helpers/tabs_helper.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue