Helper method là Ruby method available trong view/template để tạo HTML tags và link.
erb
<%# link_to: tạo <a> tag %>
<%= link_to "Xem bài viết", post_path(@post), class: "btn" %>
<%= link_to "Xóa", post_path(@post), method: :delete, data: { confirm: "Chắc chưa?" } %>
<%# form_with: tạo form (RESTful-aware) %>
<%= form_with model: @post do |f| %>
<%= f.text_field :title %>
<%= f.submit "Lưu" %>
<% end %>form_with model: @post tự biết dùng POST /posts (tạo mới) hay PATCH /posts/:id (cập nhật) dựa vào @post.persisted?.
Từ Rails 5.1+ form_with thay thế form_for và form_tag.