Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

app.my_path_url is protected

#4696

Happens in beta3 and master:

./script/rails c
Loading development environment (Rails 3.0.0.beta3)
ree-1.8.7-2010.01 > app.escalation_definitions_path
NoMethodError: protected method `escalation_definitions_path' called for #<ActionDispatch::Integration::Session:0x105500090>
    from /Users/rando/.rvm/gems/ree-1.8.7-2010.01/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'
    from (irb):1
ree-1.8.7-2010.01 > app.escalation_definitions_url
NoMethodError: protected method `escalation_definitions_url' called for #<ActionDispatch::Integration::Session:0x105500090>
    from /Users/rando/.rvm/gems/ree-1.8.7-2010.01/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'
    from (irb):2
    from :0

Reported by Paul Sadauskas (Rando) · May 26th, 2010 @ 12:31 AM

State: resolved
Milestone: 3.0.2
Assigned to: Yehuda Katz (wycats) Yehuda Katz (wycats)
Importance: High

Activity

  1. Yehuda Katz (wycats)
    Yehuda Katz (wycats)
    • Milestone cleared.
    • State changed from new to open

    May 26th, 2010 @ 12:31 AM

  2. Rohit Arondekar
    Rohit Arondekar

    I'm getting undefined method for Rails master on 1.9.2-head


    NoMethodError: undefined method escalation_definitions_path' for #<ActionDispatch::Integration::Session:0x000000033caa98><br/>

    from /home/rohit/remote-repos/rails_patches/working4/actionpack/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'
    

    Similarly for _url

    May 26th, 2010 @ 01:04 PM

  3. Michael Koziarski
  4. Rohit Arondekar
    Rohit Arondekar

    Confirmed on Rails master.

    Steps to reproduce:
    1] Create a rails app
    2] Generate a resource, rails g resource post
    3] Open rails console, rails c
    4] app.posts_path, will throw a protected method called error.

    What I found was in route_set.rb in /actionpack/lib/action_dispatch/routing/ the define_url_helper() method has a protected in front of :#{selector} Line nos 179. If I remove the protected, the above issue is resolved, the method is no longer protected.

    However a test fails.

    1) Failure:
    test_url_helpers_does_not_become_actions(UrlOptionsTest) [test/controller/base_test.rb:230]:
    Failed assertion, no message given.

    The following assert fails,

    assert !@controller.class.action_methods.include?("account_overview_path")

    I don't know if the test needs fixing or the code.

    June 5th, 2010 @ 06:38 AM

  5. Repository
  6. Neeraj Singh
    Neeraj Singh

    15 minutes ago it was not fixed. And now that I am ready to attach a patch it is fixed. Anyway attaching my patch :-)

    June 7th, 2010 @ 09:13 PM

  7. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to High

    October 15th, 2010 @ 11:01 PM