GitXplorerGitXplorer
s

ams_208

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
f5639670c6fd2dcf7e79e5f7bd38afed355d5dd4

add the rest of the instructions to the README

ssteveklabnik committed 12 years ago
Unverified
11dd50a3e104f81bf775bc6ad54e2a1ad86395eb

fix up README

ssteveklabnik committed 12 years ago
Unverified
4f3ede579a8bfc401d1daa290d4b373b7129cc93

initial commit

ssteveklabnik committed 12 years ago

README

The README file for this repository.

== README

This is intended to reproduce https://github.com/rails-api/active_model_serializers/issues/208

You'll also need to grab https://github.com/steveklabnik/blorgh

Finally, you'll need to change Gemfile references in both the app and the engine to point at your own copy of rails and blorgh, rather than mine.

=== The issue

Basically,

def utt_url
  app.routes.url_helpers.root_path
  #Blorgh::Engine.routes.url_helpers.root_path
end

This doesn't work. Flip the comments, and it does. This is a bug.

You can find this code in the Blorgh repo, app/serializers/blorgh_serializer.rb

You can get an entry by spinning up a server,

$ bin/rails s

hitting the right page

$ open http://localhost:3000/blog/posts/new

Filling out the form, then hitting create. It should redirect you to

http://localhost:3000/blog/posts/1

Which should give you the serialized json.

If I make a change to Rails:

diff --git a/actionpack/lib/action_controller/railtie.rb b/actionpack/lib/action_controller/railtie.rb index 5379547..831c007 100644 --- a/actionpack/lib/action_controller/railtie.rb +++ b/actionpack/lib/action_controller/railtie.rb @@ -43,8 +43,9 @@ module ActionController options.relative_url_root ||= app.config.relative_url_root

   ActiveSupport.on_load(:action_controller) do
  •    include app.routes.mounted_helpers
    
  •    include AbstractController::UrlFor
       extend ::AbstractController::Railties::RoutesHelpers.with(app.routes)
    
  •    include app.routes.mounted_helpers
       extend ::ActionController::Railties::Helpers
    
       options.each do |k,v|
    

It still doesn't actually fix things. Drat.