---
title: "ruby on rails 日历插件"
author: "PBFox"
date: "2007-09-25T14:22:00Z"
tags: []
slug: "ruby-on-rails"
draft: false
lastmod: "2007-09-25T14:22:00Z"
id: 479280
url: "https://developerwork.iteye.com/blog/479280"
---

打开自己的项目，安装Rails plugins:

```
     rubyscript/plugininstallhttp://dhtml-calendar.googlecode.com/svn/trunk 

把下面的代码放到layout页面中:

    <%= dhtml_calendar_includes %>

在需要用到日历的页面中加入以下代码:

   <%= calendar_box 'role', 'start_data',
       { :class => 'date',
         :date => '2008-10-10',
         :field_title => 'Birthday',
         :button_title => 'Show calendar' },
       { :firstDay => 1,
         :range => [2005, 2015],
         :step => 1,
         :showOthers => true,
         :cache => true }
  %>
```