Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Inflector support for routes and acronyms #8015

Closed
nathansamson opened this Issue Oct 23, 2012 · 5 comments

Comments

Projects
None yet
7 participants

I have the following inflection rules

  inflect.acronym 'UI'
  inflect.acronym 'SIMs'
  inflect.acronym 'SIM'
  inflect.irregular 'SIM', 'SIMs'

I have the following routing rule

resource :x
resource :sim do
end
end

When I run rake routes

        x_sim POST   /x/sim(.:format)              my_friends/core/ui/sIMs#create
    new_x_sim GET    /x/sim/new(.:format)          my_friends/core/ui/sIMs#new
   edit_x_sim GET    /x/sim/edit(.:format)         my_friends/core/ui/sIMs#edit
                         GET    /x/sim(.:format)              my_friends/core/ui/sIMs#show
                         PUT    /x/sim(.:format)              my_friends/core/ui/sIMs#update
                         DELETE /x/sim(.:format)              my_friends/core/ui/sIMs#destroy

Note that the capitalization on SIMs is already broken in the routes.

Nevertheless when I access /x/sim/new it gives me

uninitialized constant MyFriends::Core::UI::SIMsController

Which is strange since it is defined in my_friends/core/ui/sims_controller.rb (renaming sims_controller doesn't help)
Other controller in the same directory are correctrly found and working

A similar issue is reporter at http://stackoverflow.com/questions/9522843/impossible-to-get-pluralized-acronym-route-working

I am using rails 3.2.8

@fredwu fredwu added a commit to fredwu/rails that referenced this issue Nov 9, 2012

@fredwu fredwu Fixed a bug where the inflector would replace camelCase strings and d…
…isregarding specified acronyms, fixes #8015
ee698b2
Member

senny commented Feb 22, 2013

/cc @fxn

@fxn fxn closed this in 515feb1 Mar 16, 2013

Contributor

MacksMind commented Mar 17, 2013

@fxn Since #8156 was reverted, this needs to be reopened when you get the chance.

Contributor

fredwu commented Mar 17, 2013

I'm taking a look at this and will fix my patch.

@fxn fxn reopened this Mar 17, 2013

@fredwu fredwu added a commit to fredwu/rails that referenced this issue Mar 17, 2013

@fredwu fredwu Fixed a bug where the inflector would replace camelCase strings and d…
…isregarding specified acronyms, fixes #8015, closes #8156
7624b86

@nathansamson nathansamson added the stale label Apr 23, 2014

Owner

rafaelfranca commented May 1, 2014

This issue has been automatically marked as stale because it has not been commented on for at least
three months.

The resources of the Rails team are limited, and so we are asking for your help.

If you can still reproduce this error on the 4-1-stable, 4-0-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

@rails-bot rails-bot closed this May 27, 2014

This issue has been automatically closed because of inactivity.

If you can still reproduce this error on the 4-1-stable, 4-0-stable branches or on master,
please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions.

@matthewd matthewd added a commit that referenced this issue Sep 5, 2014

@matthewd matthewd Fix for inflector's incorrect camelCase replacement for acronyms
Fixes #8015, #9756.

[Fred Wu & Matthew Draper]
ccbb481

@trungpham trungpham added a commit to trungpham/rails that referenced this issue Sep 18, 2014

@matthewd @trungpham matthewd + trungpham Fix for inflector's incorrect camelCase replacement for acronyms
Fixes #8015, #9756.

[Fred Wu & Matthew Draper]
22a5c16

@sachin004 sachin004 added a commit to sachin004/rails that referenced this issue Dec 13, 2014

@matthewd @sachin004 matthewd + sachin004 Fix for inflector's incorrect camelCase replacement for acronyms
Fixes #8015, #9756.

[Fred Wu & Matthew Draper]
211cfb9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment