0

I want to obey the Rails RESTful routes approach. I have two kinds of resources:

  • data
  • repositories

Data belongs to repositories. Unlike a typical ActiveRecord application I don't use HTML forms to create these resources. Instead both entities are serialized in YAML files which I upload to persist them into my database.

Since a small import page does not take up much space and for convenience I would like to put both importer on one page.

+------------------------------+
| <Import Repositories>        |
+------------------------------+

+------------------------------+
| Repository A - <Import Data> |
+------------------------------+
| Repository B - <Import Data> |
+------------------------------+
| ...                          |

But what is the appropriate route in this case here?

Just /repositories/new or something like repositories/data/new ?

How would I go for this, respectively what is the shortest way of defining this in routes.rb. The repositories are moddeled through classes, the data not (to keep it general). So maybe

resource repositories

is just fine?

4

1 回答 1

0

至于我,没关系。存储库是一个主要实体,数据属于它。它类似于带有 accept_nested_attributes 形式的视图。

于 2013-09-14T13:38:42.517 回答