Ruby on Rails 用户日期输入
我一直在寻找一个好的gem/插件来允许用户直观地输入日期(即从弹出日历中选择日期)。
calendardateselect 看起来确实不错,但它已不再处于活跃开发阶段,并且无法再正确安装。
我找到了其他一些,但它们都很陈旧。 Stack Overflow 用户使用什么在 Rails 中输入日期?
根据 @bjg 和 @Fortuity jQuery UI 是我决定前进的方向。启动并运行它有点复杂,所以我写了一个简短的操作方法-为他人。
I've been search around for a good gem/plug-in to allow intuitive user input of a date(i.e. select a date from a pop-up calendar).
calendardateselect looks really good, but it's no longer in active development, and no longer installs correctly.
I found a few others, but they were all quite stale. What are Stack Overflow users using for date input in rails?
Per @bjg and @Fortuity jQuery UI is the direction I decided to go. Getting it up and running was a little complex, so I wrote a short how-to for others.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
自从 Ryan Bates 制作了一个展示如何在 Rails 应用程序中使用它的截屏视频以来,jQuery UI Datepicker 一直在 Rails 开发人员中流行。
对于使用的 Rails 插件jQuery UI Datepicker,请查看:
Ryan 的截屏视频包含有关如何将其与 Rails 3 一起使用的提示。table_builder 插件适用于 Rails 2.3。我还没有看到 Rails 3 的日期选择器插件,但无需插件即可轻松实现。
The jQuery UI Datepicker has been popular among Rails developers since Ryan Bates produced a screencast showing how to use it in a Rails application.
For a Rails plugin that uses the jQuery UI Datepicker, look at:
Ryan's screencast includes hints for how to use it with Rails 3. The table_builder plugin is for Rails 2.3. I haven't yet seen a datepicker plugin for Rails 3 but it's easy to implement without a plugin.
如果您愿意在应用程序中考虑 JQuery,那么非常积极支持的 jquery-ui 项目有一个日期选择器。有关详细信息,请参阅此处
If you are willing to consider JQuery in your application then the very actively supported jquery-ui project has a datepicker. See here for details