Rails 3.2 升级到 5

huangapple go评论61阅读模式
英文:

Rails 3.2 to 5 upgrade

问题

ActionView::Helpers::InstanceTag.new不接受参数,从Rails 3.2升级到5后,应该使用什么替代方法?

ActionView::Helpers::InstanceTag.new(arg1, arg2, arg3)

会出现以下错误:

ActionView::Template::Error(参数数量不正确(给定3个,期望0个))
英文:

ActionView::Helpers::InstanceTag.new is not accepting the arguments what would be the alternate for this From rails3.2 to 5

ActionView::Helpers::InstanceTag.new(arg1,arg2,arg3)

This pops out an error

ActionView::Template::Error (wrong number of arguments (given 3, expected 0))

答案1

得分: 3

以下是翻译的部分:

该类在升级到Rails 4时已被弃用/重命名。类ActionView::Helpers::InstanceTag已转换为名为ActiveModelInstanceTag的模块。完整的限定符:

ActionView::Helpers::ActiveModelInstanceTag

来源:https://stackoverflow.com/questions/18409891/uninitialized-constant-actionviewhelpersinstancetag-in-rails-4

英文:

The class was deprecated/renamed in the upgrade to rails 4. The class ActionView::Helpers::InstanceTag
is transformed into module called ActiveModelInstanceTag. Full qualifier:

ActionView::Helpers::ActiveModelInstanceTag

Source: https://stackoverflow.com/questions/18409891/uninitialized-constant-actionviewhelpersinstancetag-in-rails-4

huangapple
  • 本文由 发表于 2020年1月3日 14:58:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/59574413.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定