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

Form builder broken in Rails 5.2 #853

Closed
ttrmw opened this issue Dec 14, 2017 · 7 comments
Closed

Form builder broken in Rails 5.2 #853

ttrmw opened this issue Dec 14, 2017 · 7 comments

Comments

@ttrmw
Copy link

ttrmw commented Dec 14, 2017

Hi all,

On the 5.2.0beta branch of rails this line

fails as value isn't called with any arguments from rails tag methods, eg:

https://github.com/rails/rails/blob/659c516bef2781cc66865fc78ed5dce682566d26/actionview/lib/action_view/helpers/tags/base.rb#L53

object is available here, so shouldn't need to be passed as an arg:

https://github.com/rails/rails/blob/659c516bef2781cc66865fc78ed5dce682566d26/actionview/lib/action_view/helpers/tags/base.rb#L10

so the change should be easy, but I can't figure out how to bundle ransack against rails 5.2.0beta to fix the specs. Any guidance and I'd be happy to help out with a PR 😁

@halo
Copy link

halo commented Dec 29, 2017

@ttrmw This is part of a series of problems related to Rails 5.2, particularly I posted this problem here already: #849 (comment)

In order to keep everything in one place and avoid confusion, I suggest this issue be closed.

You may however gladly try to fix it with a pull request! :)

I can't figure out how to bundle ransack against rails 5.2.0beta to fix the specs

Can you be more specific? What did you try, where are you stuck?

@scarroll32
Copy link
Member

Try this branch for adding any fixes to. #858

@corinnekunze
Copy link

I'm experiencing this also on Rails 5.2.0.beta2 - in my request specs that call a template with a form_for I keep experiencing this error:

Failure/Error: <%= f.text_field :first_name, class: "form-control" %>
     
     ActionView::Template::Error:
       wrong number of arguments (given 0, expected 1)

When I downgrade to rails 5.1.4 or remove the ransack gem from the project this spec runs fine.

It's only when I pass in invalid params like this:

context 'invalid data' do
    it 'shows errors' do
      get edit_user_url(user)
      put user_url(user), params: { user: { email: '' } }
      expect(controller.flash[:alert]).to eq("Email can't be blank")
    end
end

Tried to pull from the polyamorous_1.3.2 branch but that didn't seem to help.

@cdesch
Copy link

cdesch commented Jan 15, 2018

Encountered the same issue on Rails 5.2.0.beta2

wrong number of arguments (given 0, expected 1)

Trace: https://gist.github.com/cdesch/91c7b74bee06fe274bcb499beae8e42a

@t2
Copy link

t2 commented Jan 31, 2018

Still within Rails 5.2 RC1. I am sure everyone is aware of that though. Any update on progress? Is this a priority?

@corinnekunze
Copy link

corinnekunze commented Jan 31, 2018

@bbonislawski has PR open for fixes for this.

#859

I created a merge commit but I can't get travis CI to understand which activerecord gem to use (specs pass locally).

Merge fork:
spark-solutions#1

@t2
Copy link

t2 commented Jan 31, 2018

@corinnekunze Fantastic news! We are going to move forward with 5.2 RC1 due to our project release is quite a ways out and the ActiveStorage has already made life easier. Hopefully, the PR will be merged soon.

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

6 participants