module ActionView::Helpers::TextHelper
def concat(string)
# will either display "Logged in!" or a login link
end
concat link_to('login', action: :login)
else
concat "Logged in!"
if logged_in
# is the equivalent of <%= "hello" %>
concat "hello"
<%
output text within a non-output code block (i.e., <% %>), you can use the concat method.
do not operate as expected in an eRuby code block. If you absolutely must
<%= "text" %> eRuby syntax. The regular _puts_ and _print_ methods
The preferred method of outputting text in your views is to use the
def concat(string) output_buffer << string end