The view doesen't capitalize first_name and last_name. Both of them are stored in downcase inside the db. In the model I have the following getters either for first_name and last_name:
def first_name
string_to_return = read_attribute(:first_name)
return string_to_return.capitalize if string_to_return != nil && !string_to_return.strip.empty?
return "N/A"
So I expect that in the view the first_name appear capitalized, but instead, when I edit the profile it appears in downcase, I use a form_for, the code is the following:
<%= form_for(@profile, :url=>{:action=>'update'}, :html => {:multipart => true}) do |f| %>
<div class="field">
<%= f.label :first_name %><br />
<%= (f.text_field (:first_name)).capitalize %>
</div>
<div class="field">
<%= f.label :last_name %><br />
<%= (f.text_field (:last_name))%>
</div>
<%end%>
I tried all the combinations of parenthesis without success, I tried to use and not use the capitalize function in the view but the result it's always the same: DOWNCASE
Any suggestion ? Tnx