
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
rails_bootstrap_easy_navbar
Advanced tools
RailsBootstrapEasyNavbar is a Ruby on Rails gem for creating a simple navigation bar with twitter-bootstrap styling. It suits rapid prototyping as it can be setup within minutes.
Make sure you have the twitter bootstrap stylesheets and javascript files installed. They can be installed in anyway. Either via gems or raw stylesheets and javascript files. For easy installation check out these gems: 'bootstrap-sass' & 'twitter-bootstrap-rails'
The navigation bar may only be a maximum of two levels.
Add this line to your application's Gemfile:
gem 'rails_bootstrap_easy_navbar'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rails_bootstrap_easy_navbar
With RailsBootstrapEasyNavbar you can create a bootstrap styled navbar with one method call containing your current page name and a JSON object.
From within a view create a navbar with:
create_navbar(@current_page, @navbar_tabs)
The current page variable is the title of the current tab in string format
The navbar_tabs JSON object is a hash of name, path pairs.
An example of a JSON object describing 3 main tabs:
{ "Login" => login_path, "Tasks" => tasks_path, "Project" => projects_path }
To include subtabs simply create a key named after the main tab with a value of a hash describing each of the sub tabs. Only one level of subtabs is supported.
Here is an example of a JSON object describing 3 main tabs and 2 subtabs:
{ "Login" => login_path, "Tasks" => tasks_path, "Project" => { "Open Projects" => projects_open_path, "Closed Projects" => projects_closed_path } }
You can create a responsive collapsible navbar with:
create_collapsible_navbar(@current_page, @navbar_tabs)
The creation methods take an optional hash for styling and exending the navbar.
Add a brand to the navbar with:
create_navbar(@current_page, @navbar_tabs, brand: "Website Title")
Add a link for when the brand is clicked with:
create_navbar(@current_page, @navbar_tabs, brand: "Website Title", brand_path: '/projects')
Change the Navbar class (Check out http://twitter.github.com/bootstrap/components.html#navbar for different classes) :
create_navbar(@current_page, @navbar_tabs, navbar_class: 'navbar navbar-inverse')
Add raw html inside the non collapsible nav bar area:
create_navbar(@current_page, @navbar_tabs, navbar_raw_html: @navbar_raw_html)
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.