How to set up ( Fedora php ruby on rails )

Sunday, February 20, 2011

How to remove Model Name from errors message in rails

Remove model/Table name from form errors

Here i am going to use regular expression to remove model/table name from my errors messages

<% @company.errors.full_messages.each do |msg| %>
<%= msg.gsub(/^\w+/, "").strip.capitalize %>
<% end %>

No comments:

Post a Comment