Skip to content

Conversation

@TaoufikMejri
Copy link
Contributor

@TaoufikMejri TaoufikMejri commented Nov 16, 2025

I've noticed that descriptions for alias instance methods are not rendered. For example:

...and many other alias methods.

This issue comes from the following condition in the methods partial:

# app/views/objects/show/_methods.html.erb
<% if m.is_alias? %>
  <div>An alias for <a href="<%= m.method_alias[:path] %>" class="font-bold"><%= m.method_alias[:name] %></a></div>
<% elsif m.description.empty? %>
  <div>No documentation available</div>
<% else %>
   <%= raw m.description %>
<% end %>

Because of this, if a method is an alias, its own description is skipped even when the API data actually contains documentation for that alias.

This PR updates the rendering logic so that alias methods can also display their descriptions (when present).

Edit:

After opening the PR, I noticed that this behavior differs depending on the documentation source.
For example, ruby-doc.org includes the description for alias methods, while docs.ruby-lang.org does not show the description for aliases. This suggests it may be a deliberate design choice upstream?

However, showing the description on alias methods could still provide a more complete and helpful documentation experience?

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

Successfully merging this pull request may close these issues.

1 participant