README.md in base_presenter-0.0.8 vs README.md in base_presenter-0.0.9
- old
+ new
@@ -1,10 +1,12 @@
# BasePresenter
+[![Gem Version](https://badge.fury.io/rb/base_presenter.png)](http://badge.fury.io/rb/base_presenter)
+[![Build Status](https://travis-ci.org/raglub/base_presenter.png?branch=master)](https://travis-ci.org/raglub/base_presenter)
The gem adds "Presenter" functionality into Rails application.
-## Installation
+# Installation
Add this line to your application's Gemfile:
gem 'base_presenter'
@@ -14,16 +16,25 @@
Or install it yourself as:
$ gem install base_presenter
-## Usage
+# Getting Started
-In director root_rails/app/presenters create file example_presenter.rb with content
+## First step
+Usa a generator
+
+ rails g base_presenter:install [model_name]
+
+## Second step
+
+For model_name equal 'example' we should get file in director root_rails/app/presenters/example_presenter.rb which we can improve.
+For example:
+
```ruby
-class ExamplePresenter < BasePresenter
+class ExamplePresenter < ApplicationPresenter
presents :example
delegate :id, to: :example
def name
"Name"
@@ -58,14 +69,14 @@
```erb
<% present Example do |presenter| %>
Class name: <%= presenter.class_name %>
<% end %>
```
+
## Methods
Methods of BasePresenter
Method returns span with 'None given' when value is blank
```erb
#handle_none(value)
```
-