← Back to Upcase

Problem with name spaced resources


(Yevgeniy Viktorov) #1

Hello,

I have the following in my routes.rb:

namespace :accounting do
  resource :settings
end

resource :settings

Two models

Accounting::Settings
Setting

And corresponding controllers…

For some reason when I submit data to the Accounting::SettingsController the params[:setting] is empty, after some experiments I found that it actually accepts params, but according to the global settings model.

What I’m missing? :smile:

Thanks in advance.


(Yevgeniy Viktorov) #2

fixed by renaming Accounting::Settings to Accounting::Setting, i.e. to singular


(Sean Griffin) #3

Models should always be singular in any context. Technically all class names are (Controller is singular)