PiRSquared17 / activescaffold

Automatically exported from code.google.com/p/activescaffold
MIT License
0 stars 0 forks source link

Some of the use of model name aren't formatted correctly #745

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a model called ProductSale and in a number of places it does not
appear formatted correctly.

1. On the Create New screen I get 'Create Productsale'

2. In a nested form I get 'Create Another Productsale'

Original issue reported on code.google.com by ruinenl...@gmail.com on 28 Apr 2010 at 8:29

GoogleCodeExporter commented 9 years ago
You can set the name in config/locales/en.yml:
en:
  activerecord:
    models:
      product_sale: "Product Sale"

Original comment by sergio.c...@gmail.com on 29 Apr 2010 at 10:22

GoogleCodeExporter commented 9 years ago
Ok thanks I'll do that. Strangely though it does get correctly displayed in some
places correctly, it is just those two locations that have problems.

Original comment by ruinenl...@gmail.com on 29 Apr 2010 at 11:29

GoogleCodeExporter commented 9 years ago
In _form_association_footer.html.erb just need to change:

    <% add_label = column.plural_association? ? as_(:create_another, :model =>
column.association.klass.human_name) : as_(:replace_with_new) -%>

to ..

    <% add_label = column.plural_association? ? as_(:create_another, :model =>
column.association.klass.to_s.underscore.humanize.titleize) : 
as_(:replace_with_new) -%>

Original comment by ruinenl...@gmail.com on 2 May 2010 at 2:18

GoogleCodeExporter commented 9 years ago
That change break i18n

Original comment by sergio.c...@gmail.com on 3 May 2010 at 8:21

GoogleCodeExporter commented 9 years ago
If you dislike default value for human_name when translation is not available, 
fill
a bug in rails.

Original comment by sergio.c...@gmail.com on 3 May 2010 at 8:22