How can I localize a nested virtual attribute in Rails?
Model:
class User < ActiveRecord::Base
attr_accessor :company_information
end
and view:
= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: {class: 'form-horizontal'}) do |f|
= devise_error_messages!
= f.input :email
= f.input :password
= f.input :password_confirmation
= f.simple_fields_for :company_information do |c|
= c.input :name
= f.button :submit
Translation keys (from en.yml
), such as activerecord.attributes.user.company_information.name
and activerecord.attributes.user.company_information_name
, are not selected.
source
share