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

Wrong number of arguments (0 for 1) when passing model to link_to_unless_current #28846

Closed
jbhannah opened this issue Apr 23, 2017 · 2 comments
Closed

Comments

@jbhannah
Copy link

Steps to reproduce

  • Pass a model object as the second argument to link_to_unless_current in Rails 5.1.0.rc2:
            ul.vertical.menu
              - columns_with_published_posts.each do |column|
                li = link_to_unless_current column.name, column do
                  = link_to column.name, column, class: :active

Expected behavior

  • Pass the object to url_for to determine the path to compare against

Actual behavior

wrong number of arguments (given 1, expected 0)

Full stack trace: https://gist.github.com/jbhannah/fd3fef8e2a8a341d8b29fc5f772ea5a6

System configuration

Rails version: 5.1.0.rc2

Ruby version: 2.4.1

jbhannah added a commit to thetallgrassnet/pokesite that referenced this issue Apr 23, 2017
@jbhannah
Copy link
Author

This occurred when upgrading from 5.0.2 to 5.1.0.rc2.

@maclover7
Copy link
Contributor

Hi @jbhannah! Thank you for reporting this regression. Looks like @Edouard-chin has opened #28847 to fix this.

Edouard-chin added a commit to Edouard-chin/rails that referenced this issue Apr 26, 2017
- `check_parameters` kwargs was added to the `current_page?` method, the implementation was assuming only hashes responds to `delete`. This was causing issues when `current_page?` was called with a Active Model object
- ref rails#27549
- Fixes rails#28846
jbhannah added a commit to thetallgrassnet/pokesite that referenced this issue May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants