What is a Ruby/Rails 'hook'?
I am editing some code, and I see the following:


    <% hook :login do %>
      <% form_tag user_session_path do  %>
        <p>
          <%= label :user_session, :login, 'Email Address' %><br />
          <%= text_field :user_session, 'login' %>
        </p>
        <p>
          <%= label :user_session, :password, 'Password' %><br />
          <%= password_field :user_session, 'password' %>
        </p>
        <p>
          <label>
            <%= check_box :user_session, :remember_me %>
            <%= label :user_session, :remember_me, 'Remember me' %>
          </label>
        </p>
      
        <p><%= submit_tag 'Log In' %></p>
      <% end %>
    
      or <%= link_to 'Create a new account', signup_path %> | <%= link_to 'Forgot Password', new_password_reset_path %>
    <% end %>

What does

    <% hook :login do %>
      ...
    <% end %>

do?

I spent about 5 minutes Googling and found nothing on this subject.
What is a Ruby/Rails 'hook'?
===

I am editing some code, and I see the following:


    <% hook :login do %>
      <% form_tag user_session_path do  %>
        <p>
          <%= label :user_session, :login, 'Email Address' %><br />
          <%= text_field :user_session, 'login' %>
        </p>
        <p>
          <%= label :user_session, :password, 'Password' %><br />
          <%= password_field :user_session, 'password' %>
        </p>
        <p>
          <label>
            <%= check_box :user_session, :remember_me %>
            <%= label :user_session, :remember_me, 'Remember me' %>
          </label>
        </p>
      
        <p><%= submit_tag 'Log In' %></p>
      <% end %>
    
      or <%= link_to 'Create a new account', signup_path %> | <%= link_to 'Forgot Password', new_password_reset_path %>
    <% end %>

What does

    <% hook :login do %>
      ...
    <% end %>

do?

I spent about 5 minutes Googling and found nothing on this subject.