Tidbit from RailsCast 132:
ActionController::Base.helpers is a proxy object you can use to access Rails view helpers, outside of views, e.g.:
1
ActionController::Base.helpers.pulralize(products.count, ‘product’)
|
|||||
|
Tidbit from RailsCast 132: 1 Railscast 20 reminded me that helper_method :name makes controller method name available in views. |
|||||
|
Copyright © 2010 Sam Pierson's Blog - All Rights Reserved |
|||||