Hiccdown Development Notes

Showing only #5847 and its comments.

See full discussion
  Log in or sign up to participate in this discussion.
With an account, you can revise, criticize, and comment on ideas.

Discussions can branch out indefinitely. You may need to scroll sideways.
Dennis Hackethal’s avatar
Dennis HackethalOP​·​#5847​·​​·​AI-assisted

A helper method that calls another action's helper method by name can get another helper's. Rails mixes every helper into every view, so calling index from ItemsHelper#create runs whichever helper's index Rails included last, such as PagesHelper#index:

ruby
module ItemsHelper
def index
[:ul, @items.map { |i| [:li, i.name] }]
end
def create
index # PagesHelper#index, not ItemsHelper#index
end
end

Action names like index, show and edit are in many helpers, and the Readme encourages helper methods calling one another.

CriticismCriticized1Archived
Dennis Hackethal’s avatar
Dennis HackethalOP​·​#5851​·​​·​AI-assisted

Known since #301, and accepted in #333: the alternatives, helper class methods (#1980) and separate display classes (#1982), were worse. Qualifying a helper method's name, like items_page rather than calling index, is the way around it.

Criticism of #5847Archived
  • Rationally adoptable.
  • Not rationally adoptable.
  • Older versions with pending criticisms.
  • Ideas are blue, criticisms red, comments small and gray.
  • Hover over ideas to expand them.
  • Click on ideas to jump to their place in the discussion.