Skip to content

Use Tabulous for global navbar tabs #1

@fpigerre

Description

@fpigerre

As of commit 48532f8, the Tabulous gem has been added to Investable. It currently controls the display of exchange information in the BitCoin section.

Tabulous uses controller actions to determine what information should be displayed when a tab is accessed. In account of this functionality, it may be convenient to use Tabulous when controlling navigation using the global navbar tabs.

Existing routes listed as follows could stay the same:

  get '/bitcoin' => 'bitcoin#index', :as => 'bitcoin'
  get '/comparison' => 'comparison#index', :as => 'comparison'

And the following code could be added to tabulous.rb

    comparison_tab do
      text { 'Comparison' }
      link_path { comparison_path }
      visible_when { true }
      enabled_when { true }
      active_when { in_action('index').of_controller('comparison') }
    end

It is likely that, if this solution was to be implemented, the main navbar would have to be rendered truly global, being placed in the layout file pertaining to each controller.

Further reading with regard to Tabulous:
Basic Tabulous Tutorial
Tabulous Overview Document
Tabulous Reference Document

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions