开发者

In older versions of Rails, what are the methods to say, controller <--> view sharing methods?

开发者 https://www.devze.com 2023-01-20 21:31 出处:网络
I think in newer versions of Rails, there are ways 开发者_开发百科to say, \"share these methods between controllers and views\" using something like

I think in newer versions of Rails, there are ways 开发者_开发百科to say, "share these methods between controllers and views" using something like

controller.helper
controller.helper_method 

(I am not sure if they are). But what if these methods are missing in older versions of Rails? How can you tell Rails to share methods between controllers and views?


If that's the case then something is probably wrong with your app. helper_method has been available since Rails 1.0.

http://apidock.com/rails/v1.0.0/ActionController/Helpers/ClassMethods/helper_method

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号