Link
link_to
method, remote, data, attribute
<%= link_to 'Google', 'http://google.com.sg' %> <%= link_to 'Top', {controller: :hello, action: :index}, id: :link, class :menu %> <%= link_to 'Delete' book_path(1), method: :delete, data: { confirm: "Are you sure?" } %> <%= link_to book_path(@book) do imgage_tag "http://xxx.com/book/#{@book.id}.jpg" end %>
link_to_if, link_to_unless
<% @user = User.new %> <%= link_to_if @user.nil?, 'Sign in', controller: :login, action: :index %> <%= link_to_unless @user.nil?, 'Sign in', controller: :login, action: :index %>
link_to_unless_current
If dst of link is current page, output only text
If not, outputs link
<%= link_to_unless_current 'List', action: :current %> | <%= link_to_unless_current 'Detail', action: :detail %>
mail_to
<%= mail_to 'atmarkplant@gmail.com' %> <%= mail_to 'atmarkplant@gmail.com', 'Mail' %>