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

Padrino::Routing absolut_url ignored the default values on url map #2113

Closed
fidalgo opened this Issue Jan 4, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@fidalgo
Contributor

fidalgo commented Jan 4, 2017

Do you want to request a feature or report a bug?

bug

What is the current behavior?

App.absolute_url() doesn't apply subsitution on the provided values in arguments and only uses the default values.
You can find an example in https://github.com/fidalgo/padrino-absolute-url
This line should print:
Path is http://localhost/face/a2a/CA123/agent/008/answered

Also if you add the line:
assert_equal "/pt", @app.url(:index, lang: 'pt')
to https://github.com/padrino/padrino-framework/blob/master/padrino-core/test/test_routing.rb#L1245

I would expect the test to pass

What is the expected behavior?

See previous description

Which versions of Ruby, Padrino, Sinatra, Rack, OS are you using? Did this work in previous versions?

ruby '2.3.3'
'padrino', '0.13.3.3'
sinatra (1.4.7)
Fedora Linux 25

and I suspect it was working on padrino 0.10.6 (yeah a long long time ago)

fidalgo pushed a commit to fidalgo/padrino-framework that referenced this issue Jan 4, 2017

Paulo Fidalgo
Override default values if parameter is present
As reported in bug padrino#2113 if we are using default values in the
controllers, and those values are present in the URL, they are not being
correctly replaced when building the URL.

The reason is we are using the default values as overrides and not
otherwise, the given values to override the default ones. This patch
fixes this behaviour and introduces a new test to validate it.

@ujifgc ujifgc closed this in #2114 Jan 4, 2017

ujifgc added a commit that referenced this issue Jan 4, 2017

Override default values if parameter is present
As reported in bug #2113 if we are using default values in the
controllers, and those values are present in the URL, they are not being
correctly replaced when building the URL.

The reason is we are using the default values as overrides and not
otherwise, the given values to override the default ones. This patch
fixes this behaviour and introduces a new test to validate it.

@ujifgc ujifgc referenced this issue Mar 15, 2017

Closed

Release 0.14.0 #1971

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment