Sha256: 39069f82a9d9fdc191ce9802f564b17400a8e29afbd7acf44bcfdf2c737376d3

Contents?: true

Size: 1.76 KB

Versions: 1

Compression:

Stored size: 1.76 KB

Contents

{<img src="https://codeclimate.com/github/mattways/tuning.png" />}[https://codeclimate.com/github/mattways/tuning] {<img src="https://travis-ci.org/mattways/tuning.png?branch=master" alt="Build Status" />}[https://travis-ci.org/mattways/tuning] {<img src="https://gemnasium.com/mattways/tuning.png" alt="Dependency Status" />}[https://gemnasium.com/mattways/tuning]

= Tuning

Common used tools extracted into a gem.

= Install

Put this line in your Gemfile:
  gem 'tuning'
  
Then bundle:
  $ bundle

= Controllers

(This plugin will create an error method to force debug information on exceptions in development env)

Use not_found method to respond with status 404 and show 404.html (if format it's html) in your controller:
  not_found

Use unauthorized method to respond with status 401 and show 422.html (if format it's html) in your controller:
  unauthorized

Use forbidden method to respond with status 403 and show 422.html (if format it's html) in your controller:
  forbidden

Use unprocessable_entity method to respond with status 422 and show 422.html (if format it's html) in your controller:
  unprocessable_entity

= Views

Use content_tag_if if you want wrap content into some tag if certain condition it's true:
  <%= content_tag_if request.path == home_path, :h1 do %>
    <%= link_to 'Home', home_path, id: 'logo' %>
  <% end %>

Use active_trail? if you want to check if some path is on active trail:
  <li class="<%= 'active' if active_trail? some_path %>"></li>

Use set_meta if you want to load the metadata from your locale yaml:
  set_meta # .meta.title -> @meta_title, .meta.description -> @meta_description, .meta.keywords -> @meta_keywords

The method submit_tag outputs a button with span inside:
  <button name="commit" value="submit">
    <span>Send</span>
  </button>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tuning-0.1.2 README.rdoc