Good day, i have this kind of code:
= link_to some_url do
PLENTY OF MARKUP HERE
Now i need to make this link optional, so if condition is not met i need plain MARKUP to be printed, so first anti-DRY solution:
- if condition
= link_to some_url do
PLENTY OF MARKUP HERE
-else
PLENTY OF MARKUP HERE REPEATED :(
Another solution if to put PLENTY OF MARKUP
into partial, so i winder if where is another simple solution without partial ? I tried this one:
= link_to_if condition?, some_url do
PLENTY OF MARKUP HERE
but unfortunately link_to_if
does not work as expected here.