There are two html.slim files as:
client view:
= f.input :name,
required: true,
:wrapper => :input_wrapper
company view:
= f.input :name,
required: true,
:wrapper => :input_wrapper
there is shared yml file that defines the displayed values as:
simple_form:
labels:
defaults:
name: some value
How can I define different name values for the company and the client, ideally without chenging the view? Moreover, how is the yml file linked to the slim file? For example in the routes files it is specified the url and the corresponding view file, how does that work between yml and html.slim files?
In the documentation you will find the following:
simple_form_for @admin_user, as: :some_userwill look into the yml file undersome_userinstead ofadmin_userso the yml file will look like this:So in your simple_form you can add
as: :clientandas: :companyand add those 2 to the yml file.