LeftSide build status Code Climate

left_side is a smart tool to render sidebar for your rails app

Demo: left side demo

Installation

Add this line to your application's Gemfile:

gem 'left_side'

And then execute:

$ bundle

Then run:

$ rails g left_side:install

Usage

  • require left-side in application.css
*= require left-side
  • add
<aside class='span3'>
  <% if content_for? :nav_left %>
    <%= yield :nav_left %>
  <% else %>
    <%= render_left_side controller_name %>
  <% end %>
</aside>
<section class='span21'>
  <%= yield %>
</section>

to your layout

Dependency

  • cells

  • bootstrap

How to disable left_side in some special page

  • in the action
render :layout => false

How to change the default left_side in some special page

  • in the page
<% content_for :nav_left do%>
  <%= render_left_side :tasks %>
<% end %>

tasks is the top string in the section.yml

How to modify the stylesheet

  • run
rails g left_side:stylesheet
  • modify assets/stylesheets/left-side.css.scss

TODO

  • make development mode need not restart when section.yml changed

  • add section_hint command to valid the section config

  • refactor the code

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Test

rake test