Skip to content

Instantly share code, notes, and snippets.

@abloom
Created May 19, 2009 14:35
Show Gist options
  • Save abloom/114139 to your computer and use it in GitHub Desktop.
Save abloom/114139 to your computer and use it in GitHub Desktop.
class BoardController < ActionController::Base
before_filter :build_nav_bar_links
def index
...
end
private
def build_nav_bar_links
@nav_bar_links = nav_bar_links
end
def nav_bar_links
[["Something", something_url],
["Else", else_url]]
end
end
class BoardController
include RandomPlugin::NavBarExtensions
end
module RandomPlugin
module NavBarExtensions
def nav_bar_links_with_random_plugin
links = nav_bar_links_without_random_plugin
links << ["Extra", extra_url]
end
def self.included(receiver)
receiver.alias_method_chain :nav_bar_links, :random_plugin
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment