How do I implement a Rails model named "series"? -


Singular and plural forms are the same and I get an undefended_and error while trying to kill the new method.

I know why and I know that the easiest solution would be to use another name.

I know that I can create a Custom Invocation, but what?

The problem is that I actually need a URL like / series, / series / 1 because I'm actually modeling ... wait for it ... series of events.

Does not express "set" or "sequence" or any other synonyms.

A series of events is not a series or sequence.

What is a "nickname" model?

Should I use designated routes?

Any help is appreciated.

Assume that you generate the script / generate series to create your model controller et al. , you should have a line in /config/routes.rb such as

.
  map.resources: Series   

If you change it in

  map.series_index '/ series' ,: Controller = & Gt; 'Chain',: verb = & gt ;: index map. Resource: Series  

This will work or you can add Eric Hill's Inflantant Initializer.


Comments