Blankable
Adds blank slates to index view
Installation
Add this line to your application’s Gemfile:
gem 'blankable'
And then execute:
$ bundle
Or install it yourself as:
$ gem install blankable
Usage
ruby
# Customers Controller
class CustomersController < ApplicationController
def index
@customers = Customer.all
respond_with(@customers)
end
end
```haml # views/customers/_grid.html.haml %table %tr %th Name %th Business Phone %th Mobile Phone %th Address
- @customers.each do |customer| %tr %td= customer.name %td= customer.business_phone %td= customer.mobile_phone %td= customer.address ```
haml
# views/customers/_blank.html.haml
= link_to 'Add your first customer', new_customer_path
haml
# views/customers/index.html.haml
= blankable @customers
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request