Sha256: 301c46050e667c382f0aa75d6addb370d5e15782068e880c6f19f3abdc5486c0

Contents?: true

Size: 674 Bytes

Versions: 6

Compression:

Stored size: 674 Bytes

Contents

module ApplicationHelper
  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"

    set_meta_tags(
      title: @page_title
    )

    @page_title
  end

  def sidebar_link(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
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shadcn-ui-0.0.15 app/helpers/application_helper.rb
shadcn-ui-0.0.14 app/helpers/application_helper.rb
shadcn-ui-0.0.13 app/helpers/application_helper.rb
shadcn-ui-0.0.12 app/helpers/application_helper.rb
shadcn-ui-0.0.10 app/helpers/application_helper.rb
shadcn-ui-0.0.8 app/helpers/application_helper.rb