2014-11-12 8 views
2

Я использую Rails 3.2 с рубином 2,1Почему генератор эстакад рельсов просто игнорирует мою конфигурацию/iniatilizers/inflections.rb?

Я ставлю этот код в моей конфигурации/инициализаторах/inflections.rb:

ActiveSupport::Inflector.inflections do |inflect| 
    inflect.irregular 'pub_type_contributeur', 'pub_types_contributeurs' 
    inflect.irregular 'PubTypeContributeur', 'PubTypesContributeurs' 
    end 

Когда я проверить его с моими рельсам утешать его работы:

rails console 
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message. 
Loading development environment (Rails 3.2.16) 
2.1.0 :001 > "attendance".pluralize 
=> "attendances" 
2.1.0 :002 > "pub_type_contributeur".pluralize 
=> "pub_types_contributeurs" 
2.1.0 :003 > exit 

Но когда я использую стандартный генератор, он просто игнорировать мой перегиб:

rails generate scaffold pub_type_contribueur nom:text -p 
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message. 
     invoke active_record 
     create db/migrate/20141112191424_create_pub_type_contribueurs.rb 
     create app/models/pub_type_contribueur.rb 
     invoke rspec 
     create  spec/models/pub_type_contribueur_spec.rb 
     invoke  factory_girl 
     create  spec/factories/pub_type_contribueurs.rb 
     invoke resource_route 
     route resources :pub_type_contribueurs 
     invoke scaffold_controller 
     create app/controllers/pub_type_contribueurs_controller.rb 
     invoke haml 
     create  app/views/pub_type_contribueurs 
     create  app/views/pub_type_contribueurs/index.html.haml 
     create  app/views/pub_type_contribueurs/edit.html.haml 
     create  app/views/pub_type_contribueurs/show.html.haml 
     create  app/views/pub_type_contribueurs/new.html.haml 
     create  app/views/pub_type_contribueurs/_form.html.haml 
     invoke rspec 
     create  spec/controllers/pub_type_contribueurs_controller_spec.rb 
     create  spec/views/pub_type_contribueurs/edit.html.haml_spec.rb 
     create  spec/views/pub_type_contribueurs/index.html.haml_spec.rb 
     create  spec/views/pub_type_contribueurs/new.html.haml_spec.rb 
     create  spec/views/pub_type_contribueurs/show.html.haml_spec.rb 
     create  spec/routing/pub_type_contribueurs_routing_spec.rb 
     invoke helper 
     create  app/helpers/pub_type_contribueurs_helper.rb 
     invoke  rspec 
     create  spec/helpers/pub_type_contribueurs_helper_spec.rb 
     invoke assets 
     invoke coffee 
     invoke scss 
     invoke scss 

Что я делаю неправильно?

ответ

0

Хорошо, когда мы работаем слишком поздно и ошибочно назвали имя ... извините, это мое плохое, я забыл письмо «t».

моя команда была неправильно:

rails generate scaffold pub_type_contribueur nom:text --no-stylesheets -p 

Это правильный один:

rails generate scaffold pub_type_contributeur nom:text --no-stylesheets -p