开发者

Combining link_to with render :partial

开发者 https://www.devze.com 2023-02-01 22:34 出处:网络
I would like to combine 2 commands into 1, if its possible. <%= render :partial => \'shared/logo\' %>

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?


This should do it:

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

精彩评论

暂无评论...
验证码 换一张
取 消