diff options
author | francis <francis> | 2007-09-05 11:45:17 +0000 |
---|---|---|
committer | francis <francis> | 2007-09-05 11:45:17 +0000 |
commit | d99a7eb7667a77145a48e2ca68885c14b917657a (patch) | |
tree | eb53505893489a2e1e4ecbdd74822aae64828cd5 | |
parent | c6fae6ef88127f8463c7c328c6f96afd5bc1cb08 (diff) |
Do HTML 4.0 output in a nicer way
-rw-r--r-- | app/helpers/application_helper.rb | 6 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 2 | ||||
-rw-r--r-- | config/environment.rb | 9 | ||||
-rw-r--r-- | todo.txt | 1 |
4 files changed, 10 insertions, 8 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cf0845970..d645a8b95 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,12 +1,6 @@ # Methods added to this helper will be available to all templates in the application. module ApplicationHelper - # This was the best solution I could find to this, yeuch. - # http://www.ruby-forum.com/topic/88857 - def stylesheet_link_tag_html4( _n ) - return stylesheet_link_tag( _n ).gsub( ' />', '>' ) - end - # Copied from error_messages_for in active_record_helper.rb def foi_error_messages_for(*params) options = params.last.is_a?(Hash) ? params.pop.symbolize_keys : {} diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 8ec31ea19..6045e5f93 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -3,7 +3,7 @@ <head> <!-- <script type="text/javascript" src="/js.js"></script> --> <title>Freedom of Information Filer and Archive <%= @title ? "-" : "" %> <%=@title%></title> - <%= stylesheet_link_tag_html4 'main' %> + <%= stylesheet_link_tag 'main' %> </head> <body> <h1 id="header">Freedom of Information Filer and Archive <span id="beta">Beta</span></h1> diff --git a/config/environment.rb b/config/environment.rb index ade28bba0..ed71aa5d5 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -61,7 +61,16 @@ end ActiveRecord::Errors.default_error_messages[:blank] = "must be filled in" # Include your application configuration below + +# Include our own helper functions $:.push("../rblib") load "validate.rb" +# Output HTML 4.0 compliant code, using method described in this ticket +# http://dev.rubyonrails.org/ticket/6009 +ActionView::Helpers::TagHelper.module_eval do + def tag(name, options = nil, open = false) + "<#{name}#{tag_options(options.stringify_keys) if options}>" + end +end @@ -1,4 +1,3 @@ -Fix up how we do HTML 4.0 |