When I place it before the default rails routes I get the category pages
working, but the global actions (/admin/films/edit/1) error out with the
following error:
'No action responded to 1'
When I place it after the default rails routes the category pages don't
work and I get the following error:
'No action responded to narrative_features'
(narrative_features being on of the categories films can belong to)
What you first want to do is to create a separate categories model and
probably have an habtm relationship between films and categories (a film
can have many categories and a a category can have many films). You
should (generally) not do things like serialized arrays in database
columns for things that are logical entities in your model. Basically,
this is not a "normalized" database.
For example, if you delete the last film that was part of the category
"Western", you would no longer have "Western" as a category.
What you first want to do is to create a separate categories model and
probably have an habtm relationship between films and categories (a film
can have many categories and a a category can have many films). You
should (generally) not do things like serialized arrays in database
columns for things that are logical entities in your model. Basically,
this is not a "normalized" database.
For example, if you delete the last film that was part of the category
"Western", you would no longer have "Western" as a category.
Paul
I tottally hear ya. I did this knowing it was lazy development, and that
I would have to rewrite it eventually.
In regards to the routes. Will I use a regex that checks to make sure
that the :category matches only the available categories? Not sure how
that is going to solve my problem.