Rails - How to connect Helper to Controller Module
Posted
by
red eye
on Stack Overflow
See other posts from Stack Overflow
or by red eye
Published on 2012-11-20T04:57:52Z
Indexed on
2012/11/20
4:59 UTC
Read the original article
Hit count: 184
ruby-on-rails
|ruby-on-rails-3
I have helper:
module BreadcrumbsHelper
def breadcrumbs_cache_wrap(key, options, &block)
...
end
end
And i extract part of Controller to module:
module ApplicationController::Breadcrumbs
def default_breadcrumbs
...
end
class ApplicationController
include ApplicationController::Breadcrumbs
...
end
Now i want to connect Helper to Controller. I can do it like this:
class ApplicationController
include ApplicationController::Breadcrumbs
helper :breadcrumbs
...
end
It's working. But can i incapsulate connection to Breadcrumbs Module?
module ApplicationController::Breadcrumbs
helper :breadcrumbs
...
end
Unfortunately this code is not working "undefined method `helper'".
© Stack Overflow or respective owner