Patch #966

DRY: Move repetitive calendar include code from views into helper

Added by Peter Suschlik over 9 years ago. Updated over 9 years ago.

Status:ClosedStart date:2008-03-31
Priority:LowDue date:
Assignee:-% Done:

0%

Category:UI
Target version:0.8

Description

Avoid repetitive code snippets seen in many views:

<% content_for :header_tags do %>
<%= javascript_include_tag 'calendar/calendar' %>
<%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
<%= javascript_include_tag 'calendar/calendar-setup' %>
<%= stylesheet_link_tag 'calendar' %>
<% end %>

Move that code to ApplicationHelper in call it implicitly when calling calendar_for('field_id').

calendar_include_dry.patch Magnifier - Move repetitive calendar include code from views into helper (6.11 KB) Peter Suschlik, 2008-03-31 18:06

Associated revisions

Revision 1315
Added by Jean-Philippe Lang over 9 years ago

Move repetitive calendar include code from views into helper (patch #966 by Peter Suschlik).

History

#1 Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from New to Closed
  • Target version set to 0.8

This patch cleaned the views indeed.
Committed in r1315 with slight changes. Thanks.

Also available in: Atom PDF