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

Default all labels to human_attribute_name instead of raw attr_name #667

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/administrate/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def permitted_attributes
delegate :resource_class, :resource_name, :namespace, to: :resource_resolver
helper_method :namespace
helper_method :resource_name
helper_method :resource_class

def resource_resolver
@_resource_resolver ||=
Expand Down
2 changes: 1 addition & 1 deletion app/views/administrate/application/_collection.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ to display a collection of resources in an HTML table.
)) do %>
<%= t(
"helpers.label.#{resource_name}.#{attr_name}",
default: attr_name.to_s,
default: resource_class.human_attribute_name(attr_name),
).titleize %>

<% if collection_presenter.ordered_by?(attr_name) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/administrate/application/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ as well as a link to its edit page.
<dt class="attribute-label">
<%= t(
"helpers.label.#{resource_name}.#{attribute.name}",
default: attribute.name.titleize,
default: page.resource.class.human_attribute_name(attribute.name),
) %>
</dt>

Expand Down