Skip to content

Commit

Permalink
README: Added description, usage and installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
olejrosendahl committed Sep 11, 2015
1 parent 9695814 commit cec4d09
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[travis]: https://travis-ci.org/blacktangent/buttons_for
[codeclimate]: https://codeclimate.com/github/blacktangent/buttons_for
[fontawesome]: https://fortawesome.github.io/Font-Awesome
[fontawesomerails]: https://github.com/bokmann/font-awesome-rails
[coveralls]: https://coveralls.io/r/blacktangent/buttons_for

# ButtonsFor
Expand All @@ -8,9 +10,7 @@
[![Code Climate](https://codeclimate.com/github/blacktangent/buttons_for/badges/gpa.svg)][codeclimate]
[![Test Coverage](http://img.shields.io/coveralls/blacktangent/buttons_for/master.svg)][coveralls]

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/buttons_for`. To experiment with that code, run `bin/console` for an interactive prompt.

TODO: Delete this and the text above, and describe your gem
ActiveView helper to generate Bootstrap buttons and dropdown-buttons.

## Installation

Expand All @@ -28,9 +28,23 @@ Or install it yourself as:

$ gem install buttons_for

The gem depends on [Bootstrap 3](http://getbootstrap.com/) to create buttons and dropdown-buttons. Bring bootstrap into
your project by using [Bootstrap for Sass](https://github.com/twbs/bootstrap-sass) or you preferred method.

`buttons_for` depends on [Font Awesome][fontawesome] icon and CSS
framework, bring [Font Awesome][fontawesome] into your project using
[font-awesome-rails][fontawesomerails] or your preferred method.

## Usage

TODO: Write usage instructions here
```erb
<%= buttons_for @project do |b| %>
<%= b.button :complete, new_project_complete_path(@project), icon: "check" %>
<%= b.new %>
<%= b.edit %>
<%= b.delete %>
<% end %>
```

## Development

Expand Down
10 changes: 6 additions & 4 deletions test/buttons_for_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

class ButtonsFor::Rails::ButtonsForHelperTest < ActionView::TestCase

def with_concat_buttons_for(*args, &block)
concat buttons_for(*args, &block)
end

test "#button" do
with_concat_buttons_for(Object.new) { |b| b.button "New", "#" }
assert_select "a.btn[href=\"#\"][title=\"New\"]", text: "New"
Expand All @@ -32,4 +28,10 @@ def with_concat_buttons_for(*args, &block)
end
end

private

def with_concat_buttons_for(*args, &block)
concat buttons_for(*args, &block)
end

end

0 comments on commit cec4d09

Please sign in to comment.