ruby on rails 日历插件
打开自己的项目,安装Rails plugins: ruby script/plugin install http://dhtml-calendar.googlecode.com/svn/trunk
把下面的代码放到layout页面中:
<%= dhtml_calendar_includes %>
在需要用到日历的页面中加入以下代码:
<%= calendar_field '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 }
%>
把下面的代码放到layout页面中:
<%= dhtml_calendar_includes %>
在需要用到日历的页面中加入以下代码:
<%= calendar_field '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 }
%>


