In Rails, you can create an anchor tag that spans multiple lines doing something like the following:
<% link_to target_url_path do %>
<span class="title">Example</span>
<span class="excerpt">Neque porro quisquam est qui dolorem ipsum...</span>
<%= image_tag 'example.png', :class => 'thumbnail' %>
<% end >
I’m wondering how I can set a value using a similar approach. In essence, something like:
<% my_variable = do %>
<span class="title">Example</span>
<span class="excerpt">Neque porro quisquam est qui dolorem ipsum...</span>
<%= image_tag 'example.png', :class => 'thumbnail' %>
<% end >
Edit: in case anyone is curious why I’m asking, it’s because facebox_link_to doesn’t appear to allow you to use the do syntax like link_to does.
I don’t really know what you want to do, however you can use the
#tappattern.If instead you want to assign a chunk of code to a variable, then you are doing it wrong because views shouldn’t set variables in that way.
Instead, use an helper.