dhtmlcalendar in ActiveScaffold

To control the date format in dhtmlcalendar within ActiveScaffold in Ruby on Rails, to make the date of 2 November 2007 appear like 02-11-2007, use:

i) if you want to affect the settings in all the application add the following to the top of your controllers/application.rb

ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMAT[:default] = ‘%d-%m-%Y’

ii) If you only want to affect the settings of the calendar in one specific controller, then add the same line only to the controller that you want:

File column plugin with ActiveScaffold upload branch

When using the file_column plugin in the active_scaffold upload branch, the documentation in the file_column doesn’t make it clear what we have to change to make it work.

In the example below the model is number and the file_column is intro.

1. In models/number.rb add:

2. in controllers/numbers_controller.rb, make sure we have:

3. in helpers/numbers_helper.rb add:

4. in views/numbers/_intro_form_column.rhtml add: