Skip to content

Bunlong/olive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Olive Gem Version Gem Total Downloads

Olive is the rails helper​ gem that enables to use content_for in controllers.

Installation

Add this line to your application's Gemfile:

gem 'olive', '~> 0.0.1'

And then execute:

$ bundle

Or install it yourself as:

$ gem install olive

Usage

Assume we want to set page title for each page.

In posts_controller.rb:

class PostsController < ApplicationController
  before_filter :set_title

  private
  def set_title
    content_for :page_title, "Posts"
  end
end

If you use haml gem , application.html.haml:

%title= yield :page_title

If you use erb, application.html:

<title><%= yield :page_title %></title>

License

MIT License

Copyright (c) 2014 - Present, Bunlong VAN ( Maintainer )

About

Olive is the rails helper​ gem that enables to use content_for in controllers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors