Yet another tabs helper for RoR
Ruby Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
test
.gitattributes
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
Gemfile
LICENSE
README.md
Rakefile
yath.gemspec

README.md

Yath

Yath is a gem that makes it easier to create tabbed links

Installation

Add this line to your application's Gemfile:

gem 'yath'

And then execute:

$ bundle

Or install it yourself as:

$ gem install yath

Usage

helper.rb

def tab_helper
  Yath::tabs current_path: request.path do |t|
    t.add_tab "Read", show_path
    t.add_tab "Edit", edit_path
    t.add_tab "Delete", delete_path, :data => {:method => :delete, :confirm => "Are you sure?" } if admin_logged_in?
  end
end

views.erb:

<%= tab_helper %>

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/vivilazio/yath. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.