if ($("#profile_notice").length == 0){ $("#profile_form").prepend('
'); } <% if @profile.valid? %> $("#profile_notice").html("<%= t('profile.update.success')%>"); $("#profile_notice").removeClass('error'); $("#profile_notice").addClass('success'); <% else %> $("#profile_notice").html("

<%= pluralize(@profile.errors.count, "error") %> <%= t('profile.update.error')%>

" +""); $("#profile_notice").removeClass('success'); $("#profile_notice").addClass('error'); <% end %>