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
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
Rather than posting such a silly question here, you could always go read for yourself...
http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html
u know, sometimes u just dont see things clear / the code looks all the same. sorry 4 bothering. but thx
Tom Tom wrote:
<td><%=h !project.calendar.nil? ? "all good" : link_to(project.title, project) %></td>
<td><%=h link_to_unless(project.calendar.nil?, project.title, project) { "all good" } %></td>
thx. appreciate it!