{"id":19692291,"url":"https://github.com/aesthetikx/ember_nested_rails","last_synced_at":"2025-10-05T11:29:13.423Z","repository":{"id":33771633,"uuid":"37428364","full_name":"Aesthetikx/ember_nested_rails","owner":"Aesthetikx","description":"Experiment to get Ember to work with nested resource routes","archived":false,"fork":false,"pushed_at":"2015-06-15T15:57:47.000Z","size":20520,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-24T04:12:42.931Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aesthetikx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-14T20:26:51.000Z","updated_at":"2015-09-08T08:57:37.000Z","dependencies_parsed_at":"2022-09-08T18:01:12.836Z","dependency_job_id":null,"html_url":"https://github.com/Aesthetikx/ember_nested_rails","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aesthetikx%2Fember_nested_rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aesthetikx%2Fember_nested_rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aesthetikx%2Fember_nested_rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aesthetikx%2Fember_nested_rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aesthetikx","download_url":"https://codeload.github.com/Aesthetikx/ember_nested_rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241001101,"owners_count":19891929,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T19:12:52.132Z","updated_at":"2025-10-05T11:29:13.329Z","avatar_url":"https://github.com/Aesthetikx.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ember Nested Rails\n\n##Configure Rails to generate ember-esque json\n```ruby\n# config/initializers/active_model_serializer.rb\nActiveModel::Serializer.setup do |config|\n  config.embed = :ids\n  config.embed_in_root = true\nend\n\n# app/serializers/post_serializer.rb\nclass PostSerializer \u003c ActiveModel::Serializer\n  attributes :id, :title, :body\n  has_many :comments\nend\n\n# app/serializers/comment_serializer.rb\nclass CommentSerializer \u003c ActiveModel::Serializer\n  attributes :id, :body\nend\n```\n\n##Configure Ember to use nested routes\n```javascript\n// frontend/app/adapters/post.js\nimport DS from \"ember-data\";\nimport UrlTemplates from \"ember-data-url-templates\";\n\nexport default DS.ActiveModelAdapter.extend(UrlTemplates, {\n  urlTemplate: '{+host}/api/posts/{/id}',\n});\n\n// frontend/app/adapters/comment.js\nimport DS from \"ember-data\";\nimport UrlTemplates from \"ember-data-url-templates\";\n\nexport default DS.ActiveModelAdapter.extend(UrlTemplates, {\n  urlTemplate: '{+host}/api/posts/{postId}/comments{/id}',\n\n  urlSegments: {\n    postId(type, id, snapshot, query) {\n      return snapshot.belongsTo('post', { id: true });\n    },\n  }\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faesthetikx%2Fember_nested_rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faesthetikx%2Fember_nested_rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faesthetikx%2Fember_nested_rails/lists"}