Created
March 1, 2012 21:21
-
-
Save eileencodes/1953326 to your computer and use it in GitHub Desktop.
Example of link_to_if from Rails API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= | |
link_to_if(@current_user.nil?, "Login", { :controller => "sessions", :action => "new" }) do | |
link_to(@current_user.login, { :controller => "accounts", :action => "show", :id => @current_user }) | |
end | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment