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

Better defaults for the Show page #2138

Closed
wants to merge 2 commits into from

Conversation

timoschilling
Copy link
Member

I'll turn this into a PR once there's code to go along with the idea.

This replaces the stale #1077.

# Renders the default table
show do
  attributes_table
end

# Removes specific attributes
show do
  attributes_table except: [:foo, :bar]
end

# Adds extra (virtual) attributes
show do
  attributes_table with: :baz
end

@timoschilling
Copy link
Member

test will follow

timoschilling added a commit that referenced this pull request Oct 22, 2014
timoschilling added a commit that referenced this pull request Oct 22, 2014
@timoschilling
Copy link
Member

We to do a banking change here.

The old attributes_table supports this:

attributes_table foo: 1, bar: 2

But this collides with the possibility to set options (:expect/:with).
This still works:

attributes_table [foo: 1, foo: 2]
attributes_table [{foo: 1, foo: 2}]

How should we deal with that?

@seanlinsley
Copy link
Contributor Author

The object would always be the first element:

attributes_table foo: 1, bar: 2
attributes_table({foo: 1, bar: 2}, except: [:foo])

@seanlinsley
Copy link
Contributor Author

It looks like this PR removes the ability to pass in a Hash, but as I said above, it's not necessary to drop that feature.

@varyonic
Copy link
Contributor

varyonic commented Jun 2, 2017

I propose to close this as incomplete (insufficient tests) and abandoned. Sean thought it could be salvaged but Timo was not convinced. I looked at finishing this myself but the benefit is minor and I don't think it is worth it.

@Fivell
Copy link
Member

Fivell commented Jun 4, 2017

@varyonic , agree

@Fivell Fivell closed this Jun 4, 2017
@deivid-rodriguez deivid-rodriguez deleted the 2138_improve_attributes_table branch June 5, 2017 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants