Rails 从版本 2 升级到版本 3。未定义的方法“calendar_date_select_includes”
我正在使用 calendar_date_select gem。
它在我的 Rails 2.3.x 版本中运行良好。
但现在我正在尝试将其升级到 3.0.10
确实陷入了所有页面的错误未定义方法'calendar_date_select_includes'
。
Gemfile 只是:
gem 'rails', '3.0.10'
gem 'mysql2', '~> 0.2.11'
gem "acts_as_list"
gem "simple_form"
gem "calendar_date_select"
gem "haml"
我的views/layouts/application.html.haml 页面有这个(注意:haml!)
%head
= stylesheet_link_tag 'contam/default.scss'
= stylesheet_link_tag 'main.css'
= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"
= javascript_include_tag "jQueryUI/js/jquery-ui-1.8.11.custom.min.js"
%script
var $j = jQuery.noConflict();
= javascript_include_tag :defaults
= calendar_date_select_includes "silver"
而且我的样式也没有被加载。
I'm using the calendar_date_select gem.
It was working fine in my rails 2.3.x versions.
But now I am trying to upgrade it to 3.0.10
Really stuck on error undefined method 'calendar_date_select_includes'
for all pages.
Gemfile just has:
gem 'rails', '3.0.10'
gem 'mysql2', '~> 0.2.11'
gem "acts_as_list"
gem "simple_form"
gem "calendar_date_select"
gem "haml"
My views/layouts/application.html.haml page has this (Note: haml !)
%head
= stylesheet_link_tag 'contam/default.scss'
= stylesheet_link_tag 'main.css'
= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"
= javascript_include_tag "jQueryUI/js/jquery-ui-1.8.11.custom.min.js"
%script
var $j = jQuery.noConflict();
= javascript_include_tag :defaults
= calendar_date_select_includes "silver"
Also my styles are not being loaded.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来官方的 Calendar Date Select gem 仍未准备好 Rails 3,如 在之前的 SO 答案中讨论过。
但是,paneq 提供的 fork 确实支持 Rails 3,因此,如果您将 Gemfile 从 更改为
它
应该让您恢复正常运行。我个人没有在 Rails 3 中使用 CDS,而是迁移到 formtastic 和 formtastic_datepicker_inputs 需要jQueryUI 的日期选择器。
It appears that the official Calendar Date Select gem is still not Rails 3 ready, as discussed in a previous SO answer.
However, a fork provided by paneq does support Rails 3, so if you change your Gemfile from
to
it should get you back up and running. I haven't personally used CDS in Rails 3, instead I migrated to formtastic and formtastic_datepicker_inputs which requires jQueryUI's date picker.