rails singular resource still plural?

前端 未结 4 637
天涯浪人
天涯浪人 2021-01-31 15:22

I have a search route which I would like to make singular but when I specify a singular route it still makes plural controller routes, is this how it\'s supposed to be?

4条回答
  •  名媛妹妹
    2021-01-31 15:48

    You could fix this by setting the plural of "search" to be uncountable so in config/initializers/inflections.rb

    ActiveSupport::Inflector.inflections do |inflect|
       inflect.uncountable %w( search )
    end
    

    This should now allow search to only be used

提交回复
热议问题