I am experimenting with a simple people/new page to practice showing error messages. Right now, with the below set-up, the error messages display okay but look a little awkward because the text says "Firstname can't be blank", "Lastname can't be blank" and so forth. Basically I want the text to say "First Name can't be blank" and "Last Name can't be blank" (with spaces), but I'm assuming the error messages are just following the attribute names I defined in the Model, and there's really no way to change those explicitly.
So how can I change that? Can I not achieve that change without making changes to this particular partial? (shared_error_messages)
Thanks,
Screenshot of the new view below.

people_controller.rb
class PeopleController < ApplicationController
def new
@person = Person.new
@people = Person.all
end
def create
@person = Person.new(person_params)
if @person.save
redirect_to new_person_path
else
render 'new'
end
end
private
def person_params
params.require(:person).permit(:firstname, :lastname, :age)
end
end
person.rb
class Person < ActiveRecord::Base
validates :firstname, presence: true, length: {maximum: 15}, format: { with: /\A[a-zA-Z]+\z/,
message: "only allows letters" }
validates :lastname, presence: true, length: {maximum: 15}, format: { with: /\A[a-zA-Z]+\z/,
message: "only allows letters" }
validates :age, presence: true, length: {maximum: 3}
end
new.html.erb
Enter your information
<hr>
<%= form_for @person do |f| %>
<%= render 'shared/error_messages', object: f.object %>
First Name: <%= f.text_field :firstname %><br>
Last Name: <%= f.text_field :lastname %><br>
Age: <%= f.number_field :age %><br>
<%= f.submit "See Your Life Clock" %>
<% end %>
shared/_error_messages
<% if object.errors.any? %>
<div id="error_explain">
<h2><%= pluralize(object.errors.count, "error") %> prohibited this from being saved to DB</h2>
<ul>
<% object.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>