mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-22 05:50:47 +02:00
Replace stray error_messages_for uses with working get_list_of_error_messages_for calls
This commit is contained in:
parent
f07a028843
commit
35cc0fceaa
3 changed files with 13 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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)) %>";
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue