Topic: Refactor model data conditional
I have a Entry model with a body (with RedCloth markup). Sometimes this body contains a "more" tag and sometimes it doesn't. This is used to create a "read more" break. Currently, it is implemented like this:
<% @entries.each do |entry| %>
<%= RedCloth.new(Entry.intro(entry.body)).to_html %><br />
<%= link_to 'Read the full entry', user_entry_path(entry.user_id,entry), :class => "go" %>
<% end %>
if entry.include? "<!--more-->"
entry_split = entry.split('<!--more-->')
Is this the best way to do this. More importantly, and what I'm really looking for, if I wanted to make the appearance of the "link_to 'read the full...'..." similarly conditional, how would I do that?