--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Creates a link tag of the given <tt>name</tt> using a URL created by the set of <tt>options</tt> if <tt>condition</tt> is true, in which case only the name is returned. To specialize the default behavior, you can pass a block that accepts the name or the full argument list for link_to_unless (see the examples in link_to_unless).
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  &lt;%= link_to_if(@current_user.nil?, &quot;Login&quot;, { :controller =&gt; &quot;sessions&quot;, :action =&gt; &quot;new&quot; }) %&gt;\n  # If the user isn't logged in...\n  # =&gt; &lt;a href=&quot;/sessions/new/&quot;&gt;Login&lt;/a&gt;\n\n  &lt;%=\n     link_to_if(@current_user.nil?, &quot;Login&quot;, { :controller =&gt; &quot;sessions&quot;, :action =&gt; &quot;new&quot; }) do\n       link_to(@current_user.login, { :controller =&gt; &quot;accounts&quot;, :action =&gt; &quot;show&quot;, :id =&gt; @current_user })\n     end\n  %&gt;\n  # If the user isn't logged in...\n  # =&gt; &lt;a href=&quot;/sessions/new/&quot;&gt;Login&lt;/a&gt;\n  # If they are logged in...\n  # =&gt; &lt;a href=&quot;/accounts/show/3&quot;&gt;my_username&lt;/a&gt;\n"
full_name: ActionView::Helpers::UrlHelper#link_to_if
is_singleton: false
name: link_to_if
params: (condition, name, options = {}, html_options = {}, &block)
visibility: public
