# Need quick help with view syntax

**URL:** <https://www.ruby-forum.com/t/need-quick-help-with-view-syntax/192777>\
**Category:** Rails\
**Created:** [August 5, 2010, 11:33am UTC](https://www.ruby-forum.com/t/need-quick-help-with-view-syntax/192777 "2010-08-05T11:33:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomtt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e47c2d/32.png) [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Post date:** [August 5, 2010, 11:33am UTC](https://www.ruby-forum.com/t/need-quick-help-with-view-syntax/192777/1 "2010-08-05T11:33:10Z")

</div>

hi,

whats the correct syntax for that: (if possible)

project\<has\_one\>calendar

\<%=h !project.calendar.nil? ? "all good" : link\_to(project.title, project) %\>

im not sure of the “link\_to” part.

thx

---

<div class="post-metadata">

**Author:** ![tomtt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e47c2d/32.png) [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Post date:** [August 5, 2010, 3:28pm UTC](https://www.ruby-forum.com/t/need-quick-help-with-view-syntax/192777/2 "2010-08-05T15:28:43Z")

</div>

Rather than posting such a silly question here, you could always go read  
for yourself…

> **[ActionView::Helpers::UrlHelper](https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html)**
>
> Provides a set of methods for making links and getting URLs that depend on the routing subsystem (see ActionDispatch::Routing).

---

<div class="post-metadata">

**Author:** ![tomtt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e47c2d/32.png) [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Post date:** [August 5, 2010, 3:39pm UTC](https://www.ruby-forum.com/t/need-quick-help-with-view-syntax/192777/3 "2010-08-05T15:39:37Z")

</div>

u know, sometimes u just dont see things clear / the code looks all the  
same. sorry 4 bothering.  
but thx

---

<div class="post-metadata">

**Author:** ![tomtt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e47c2d/32.png) [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Post date:** [August 5, 2010, 3:53pm UTC](https://www.ruby-forum.com/t/need-quick-help-with-view-syntax/192777/4 "2010-08-05T15:53:53Z")

</div>

Tom T. wrote:

> \<%=h !project.calendar.nil? ? "all good" : link\_to(project.title, project) %\>

\<%=h link\_to\_unless(project.calendar.nil?, project.title, project) { "all good" } %\>

---

<div class="post-metadata">

**Author:** ![tomtt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e47c2d/32.png) [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Post date:** [August 5, 2010, 4:00pm UTC](https://www.ruby-forum.com/t/need-quick-help-with-view-syntax/192777/5 "2010-08-05T16:00:41Z")

</div>

thx. appreciate it!
