Module: ApplicationHelper
- Defined in:
- app/helpers/application_helper.rb
Instance Method Summary collapse
Instance Method Details
#page_title ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/helpers/application_helper.rb', line 2 def page_title @page_title = "" if request.path.include?("/docs/components") component_name = params[:component].to_s.titleize @page_title << "#{component_name} - " if component_name.present? end @page_title << "shadcn/ui on Rails" ( title: @page_title ) @page_title end |
#sidebar_link(text, path) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'app/helpers/application_helper.rb', line 17 def (text, path) classes = "group flex w-full items-center rounded-md border border-transparent px-2 py-1 hover:underline" classes << if request.path == path " text-foreground font-bold" else " text-muted-foreground" end link_to text, path, class: classes end |