= DateboxEngine DateboxEngine is a very simple Rails engine which provides a helper method to instantly deploy the DateBox into your application. The DateboxEngine also includes JSCalendar as a subset of functionality. It is in the long term goal to enable this plugin to be able to be used as a whole, or by accessing each part. Whether that is the JSCalendar with a default text input box, advanced DateBox input without JSCalendar, or with both combined which is currently the default. This software package is developed using the Engines plugin. To find out more about how to use engines in general, go to http://rails-engines.rubyforge.org for general documentation about the Engines mechanism. == Dependancies This plugin currently only works with the engines or edge_engines branch located at: Latest: http://opensvn.csie.org/rails_engines/branches/engines/ Edge: http://opensvn.csie.org/rails_engines/branches/edge_engines/ == Installation 1. Create your Rails application, set up your databases, grab the Engines plugin and the DateboxEngine, and install them. 2. Install the DateboxEngine into your vendor/plugins directory 3. Modify your Engines.start call in config/environment.rb Engines.start :datebox # or :datebox_engine 4. Edit your application.rb file so it looks something like the following: class ApplicationController < ActionController::Base include DateboxEngine end 5. Edit your application_helper.rb file: module ApplicationHelper include DateboxEngine end 6. The DateboxEngine provides a core stylesheets and in addition to several javascript files, so you'll need to include these two lines within your application's layout. Add the following lines: <%= engine_stylesheet "datebox_engine", "calendar-blue" %> <%= engine_javascript "datebox_engine", "calendar", "lang/calendar-en", "calendar-setup" %> == Configuration Some configuration parameters are available to allow to you control how the data is stored, should you be unhappy with the defaults. These are outlined below. module DateboxEngine config :elementId, "dateField" end === Configuration Options +elementId+:: This option will set the elementId used within the generated HTML by the helper methods == Usage Once it has been installed, to use the datebox within your application paste this line into any of your views: <%= date_box %> To adjust the default value, set the "@dateField" variable, before using the date_box helper method. <% @dateField = model.date %> If you have modified the config variable for "elementId", then use the new value as the variable name. For example, if you changed the config of "elementId" within your environment.rb like the following: module DateboxEngine config :elementId, "someNewValue" end then you set: <% @someNewValue = model.date %> == License Copyright (c) 2006 Nathaniel Brown GNU Lesser General Public License Version 2.1, February 1999 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA