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

ArgumentError at /nested wrong number of arguments (2 for 1) when use namspace route for class app #69

Open
tablecell opened this issue Sep 11, 2021 · 0 comments

Comments

@tablecell
Copy link

tablecell commented Sep 11, 2021

require 'nyny'
class Ping < NYNY::App
  get '/' do #this will be accessbile at '/ping'
    'pong'
  end
end

class App < NYNY::App
  get '/' do
    'Hello'
  end

  # You can pass a Rack app to the namespace
 namespace '/ping', Ping

  # Or you can pass a block, which will create the app for you
 namespace '/nested' do
 

    get '/' do # this will be accessible at '/nested'
      'Hello from namespace!'
    end
  end
end

visit http://localhost:9292/nested/ is ok
visit http://localhost:9292/ping throw ArgumentError
it seems that namespace only works fine with block but not for class

@tablecell tablecell changed the title No template engine registered for index.slim template not updated after edit tpl content Sep 11, 2021
@tablecell tablecell changed the title template not updated after edit tpl content html not updated after edit tpl content Sep 11, 2021
@tablecell tablecell changed the title html not updated after edit tpl content ArgumentError at /nested wrong number of arguments (2 for 1) when use namspace route for class app Sep 15, 2021
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

1 participant