{"id":16115664,"url":"https://github.com/steveklabnik/ams_208","last_synced_at":"2025-04-06T08:36:43.645Z","repository":{"id":7298240,"uuid":"8614563","full_name":"steveklabnik/ams_208","owner":"steveklabnik","description":null,"archived":false,"fork":false,"pushed_at":"2013-03-06T22:18:48.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T14:17:13.878Z","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/steveklabnik.png","metadata":{"files":{"readme":"README.rdoc","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":"2013-03-06T22:16:06.000Z","updated_at":"2020-06-25T00:53:06.000Z","dependencies_parsed_at":"2022-08-29T16:51:01.712Z","dependency_job_id":null,"html_url":"https://github.com/steveklabnik/ams_208","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/steveklabnik%2Fams_208","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steveklabnik%2Fams_208/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steveklabnik%2Fams_208/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steveklabnik%2Fams_208/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steveklabnik","download_url":"https://codeload.github.com/steveklabnik/ams_208/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247457699,"owners_count":20941905,"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-10-09T20:19:28.232Z","updated_at":"2025-04-06T08:36:43.604Z","avatar_url":"https://github.com/steveklabnik.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"== README\n\nThis is intended to reproduce https://github.com/rails-api/active_model_serializers/issues/208\n\nYou'll also need to grab https://github.com/steveklabnik/blorgh\n\nFinally, you'll need to change Gemfile references in both the app and the\nengine to point at your own copy of rails and blorgh, rather than mine.\n\n=== The issue\n\nBasically, \n\n    def utt_url\n      app.routes.url_helpers.root_path\n      #Blorgh::Engine.routes.url_helpers.root_path\n    end\n\nThis doesn't work. Flip the comments, and it does. This is a bug.\n\nYou can find this code in the Blorgh repo, app/serializers/blorgh_serializer.rb\n\nYou can get an entry by spinning up a server,\n\n    $ bin/rails s\n\nhitting the right page\n\n    $ open http://localhost:3000/blog/posts/new\n\nFilling out the form, then hitting create. It should redirect you to\n\n    http://localhost:3000/blog/posts/1\n\nWhich should give you the serialized json.\n\nIf I make a change to Rails:\n\ndiff --git a/actionpack/lib/action_controller/railtie.rb b/actionpack/lib/action_controller/railtie.rb\nindex 5379547..831c007 100644\n--- a/actionpack/lib/action_controller/railtie.rb\n+++ b/actionpack/lib/action_controller/railtie.rb\n@@ -43,8 +43,9 @@ module ActionController\n       options.relative_url_root ||= app.config.relative_url_root\n \n       ActiveSupport.on_load(:action_controller) do\n-        include app.routes.mounted_helpers\n+        include AbstractController::UrlFor\n         extend ::AbstractController::Railties::RoutesHelpers.with(app.routes)\n+        include app.routes.mounted_helpers\n         extend ::ActionController::Railties::Helpers\n \n         options.each do |k,v|\n\nIt still doesn't actually fix things. Drat.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteveklabnik%2Fams_208","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteveklabnik%2Fams_208","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteveklabnik%2Fams_208/lists"}