Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug? #57

Open
ssr124 opened this issue Jan 2, 2013 · 2 comments
Open

Possible bug? #57

ssr124 opened this issue Jan 2, 2013 · 2 comments

Comments

@ssr124
Copy link

ssr124 commented Jan 2, 2013

I'm seeing strange behaviour when running the following piece of code. Ramaze seems to initialize the controller 4 times (and invoke the action 4 times as well!) when a method returns a response via the "respond!" method. Browsing to / shows "main.ctor" and "main.index" messages once in the terminal, but browsing to /foo shows "main.ctor" and "main.foo" 4 times.

ver - 2012.12.08


require 'ramaze'

class MainController < Ramaze::Controller
    def initialize
        puts "main.ctor"
    end

    def index
        puts "main.index"
        "index page"
    end

    def foo
        puts "main.about"
        respond! "no action", 404
    end
end

Ramaze.start
@yorickpeterse
Copy link

Tested this on Ruby 1.9.3 (ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux] to be exact) and when browsing to /foo the output is the following:

main.ctor
main.about
main.ctor
main.about
main.ctor
main.about
main.ctor
main.about

From my point of view this should not be happening but maybe I'm missing something. @manveru can you shed some light on this issue?

@leucos
Copy link

leucos commented Apr 27, 2013

Seems that Rack::Cascade is hunting every app for something else than a 404. What I don't get is why it keeps coming back to MainController. Needs more digging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants