Replace stray error_messages_for uses with working get_list_of_error_messages_for calls

This commit is contained in:
Stefan Hacker 2012-09-03 19:06:17 +02:00
parent f07a028843
commit 35cc0fceaa
3 changed files with 13 additions and 4 deletions

View file

@ -44,4 +44,13 @@ module RecurringTodosHelper
def image_tag_for_edit(todo)
image_tag("blank.png", :title =>t('todos.edit_action'), :class=>"edit_item", :id=> dom_id(todo, 'edit_icon'))
end
def get_list_of_error_messages_for(model)
if model.errors.any?
content_tag(:ul) do
model.errors.full_messages.collect { |msg| concat(content_tag(:li, msg)) }
end
end
end
end

View file

@ -27,5 +27,5 @@ function html_for_empty_form() {
}
function html_for_error_messages() {
return "<%= escape_javascript(error_messages_for('recurring_todo')) %>";
}
return "<%= escape_javascript(get_list_of_error_messages_for(@recurring_todo)) %>";
}

View file

@ -2,7 +2,7 @@
<h2><%= t('users.change_authentication_type') %></h2>
<%= error_messages_for 'user' %>
<%= get_list_of_error_messages_for @user %>
<p><%= t('users.select_authentication_type') %></p>
@ -15,4 +15,4 @@
<% end %>
</div>
</div>