Forum: Ruby on Rails Dynamic Labels in Forms

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
John P. (Guest)
on 2006-05-19 06:55
Hi,

I am pretty new to Ruby-on-Rails, but I am trying to be able to have
html labels in the HTML forms dynamic.

I would like to store label values in a database so that the client may
change them on the fly, instead of having them hardcoded in the html
form.

For example I would like the client to be able to change the html label:
Sex to Gender, if and when required. I do not want to have to be
contacted by the client to change it in the HTML form everytime.

There is a specific reason for wanting this. Does anybody know how or if
it can be done, and if so have any examples.
Regards
JW (Guest)
on 2006-05-20 04:04
Hi,

This can certainly be done in Ruby/Rails or other environments.
Assuming you've got 1 application which is reused by different clients
who need different strings, different approaches are possible.

Personally I might investigate 'localization' of your application for
each client.  This covers existing ways to do that in Rails:
http://wiki.rubyonrails.com/rails/pages/Internatio...

Depending on what you need, something as simple as serializing a hash of
label strings into each clients's profile may work.

Cheers.


> Hi,
>
> I am pretty new to Ruby-on-Rails, but I am trying to be able to have
> html labels in the HTML forms dynamic.
>
> I would like to store label values in a database so that the client may
> change them on the fly, instead of having them hardcoded in the html
> form.
>
> For example I would like the client to be able to change the html label:
> Sex to Gender, if and when required. I do not want to have to be
> contacted by the client to change it in the HTML form everytime.
>
> There is a specific reason for wanting this. Does anybody know how or if
> it can be done, and if so have any examples.
> Regards
This topic is locked and can not be replied to.