user388069
user388069

Reputation: 153

Combining link_to with render :partial

I would like to combine 2 commands into 1, if its possible.

<%= render :partial => 'shared/logo' %>
<%= link_to 'Dashboard', root_url %>

I would like to call the logo in the shared directory and have it be a link at the same time.

How would I write this?

Upvotes: 12

Views: 15891

Answers (1)

vonconrad
vonconrad

Reputation: 25377

This should do it:

<%= link_to render(:partial => 'shared/logo'), root_url %>

Upvotes: 20

Related Questions