Permalink
Browse files

Cleanup of source code display.

  • Loading branch information...
1 parent 05cb93f commit 747c07e9afb0d0153884ddc71f882bc10ee0f3c3 @clemens committed Aug 28, 2008
Showing with 10 additions and 7 deletions.
  1. +9 −1 app/helpers/application_helper.rb
  2. +1 −6 app/views/pages/setup.html.erb
View
10 app/helpers/application_helper.rb
@@ -1,4 +1,12 @@
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
-
+ def show_source(file)
+ output = ''
+ counter, lineWidth = 1, 80
+ while(line = @locale_file.gets)
+ output << "#{sprintf('%3d', counter)}: #{line}"
+ counter += 1
+ end
+ output
+ end
end
View
7 app/views/pages/setup.html.erb
@@ -23,12 +23,7 @@ rake rails:freeze:edge
<p> <%= I18n.t 'txt.setup.locale' %></p>
<blockquote>
<pre>
-<% counter = 0 %>
-<% lineWidth = 80 %>
-<% while (line = @locale_file.gets) -%>
-<%= "#{counter}: #{line}" -%>
-<% counter = counter + 1 -%>
-<% end -%>
+<%= show_source(@locale_file)%>
</pre>
</blockquote>
<p><%= I18n.t 'txt.setup.defaults' %></p>

0 comments on commit 747c07e

Please sign in to comment.