Project

olive

0.0
No commit activity in last 3 years
No release in over 3 years
Olive is the rails helper​ gem that enables content_for in controllers.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.7
~> 10.0
 Project Readme

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 )