This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit 7bd496bd179b94445dc9422e29dd6772e7cfb938
tree dc4093ac7034830e7f01223a8e23a30d13857677
parent 11cd6edb3decba6bdbf418997c5e541fdb322969
tree dc4093ac7034830e7f01223a8e23a30d13857677
parent 11cd6edb3decba6bdbf418997c5e541fdb322969
| name | age | message | |
|---|---|---|---|
| |
README | ||
| |
Rakefile | ||
| |
init.rb | ||
| |
install.rb | ||
| |
lib/ | ||
| |
spec/ | ||
| |
tasks/ | ||
| |
uninstall.rb |
README
ActionHelper
============
ActionHelper is a Rails plugin that allows you to create view helper modules
for specific actions or templates, as opposed to the controller-wide helper
facility Rails provides.
Example
=======
There are currently three ways to get action-specific helpers mixed in.
module SuperHawtnessHelper end
module ExampleSweetnessHelper end
class ExampleController < ActionController::Base
include ActionHelper
helper SuperHawtnessHelper, :only => :hawtness
def hawtness
# Only this action will get SuperHawtnessHelper since the #helper call
# above used the :only option.
end
def sweetness
# This action will get ExampleSweetnessHelper because the name matches
# the controller name and action name concatenated.
end
def supercool; action_helper ExampleSweetnessHelper
# This action will get ExampleSweetnessHelper because it just said so.
end
end
TODO
====
* Allow an action to declare what helper(s) it wants by name in addition to
passing the module itself (same as Rails does).
* Experiment with keying off the template name rather than the action (to deal
with actions that might render alternate templates)
* Build up a master module for each action so we're not doing so many extends
on every request.
* Get things self-contained so specs (including controller specs) run without
a surrounding Rails app.
Copyright (c) 2008 John D. Hume, released under the MIT license








