In baked views, under related models, the "new" link should use the singular form of the model name. #173

Closed
wants to merge 2 commits into
from

Projects

None yet

3 participants

@hftf
hftf commented Aug 12, 2011

Fixed (I think?) pull request based on ADmad's comment on the corresponding ticket

http://cakephp.lighthouseapp.com/projects/42648/tickets/1902-use-singular-form-for-new-links-in-baked-views

@renan
Member
renan commented Aug 12, 2011

If the $alias is the model $alias, so it's supposed to be singular already.

Do you have any model with an plural $alias?

@hftf
hftf commented Aug 12, 2011

Yes, I have an EventsIntervals model that belongsTo Event. I saw a "New Events Interval" link in the views for EventsIntervals, but the link text was "New Events Intervals" under "Related Events Intervals" in the view for Event.

@ADmad
Member
ADmad commented Aug 12, 2011

Well so your model name is not following convention as it doesn't end in a singular word. So its not a bug in the templates.

@hftf
hftf commented Aug 12, 2011

Oh, then that's my mistake. But now I'm curious: why is the link text only different here (plural instead of singular)? Also, shouldn't you always inflect to the singular form, regardless of naming convention, because X is always singular in "new X"? Thanks!

@ADmad
Member
ADmad commented Aug 12, 2011

No point adding extra Inflector calls. Just follow conventions. And if you can't/don't follow conventions you can always make your own bake templates and customize to your needs.

@ADmad ADmad closed this Aug 12, 2011
@renan
Member
renan commented Aug 12, 2011

The thing is: its not a bug and we can't implement features/enhancements on 1.3 releases anymore.

However, if you see the same thing happening in 2.0 while we are still developing, you could send us a pull request.

Thank you!

@hftf
hftf commented Aug 12, 2011

Ah, if I had known I didn't follow conventions (maybe bake should warn you about that?), I wouldn't have thought this was a bug. Thanks anyway for your time!

@ADmad
Member
ADmad commented Aug 12, 2011

Well the manual is pretty clear about the model naming conventions. Adding convention checks everywhere in the core isn't practical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment