Topic: really ugly code to refactor
all this is in my view
<% if current_user.couple.nil? %>
<%= render 'couple' %> <!-- Form to search for user -->
<% else %>
<% if current_user.couple %>
Waiting for <%= current_user.couple.profile %> to accept.
<%= link_to 'Undo', couple_path(current_user), :confirm => "Are you sure?" , :method => :delete %>
<% else %>
<% user = User.find(current_user.couple.couple_id) %>
<% unless user.couple.nil? && (user.couple.couple_id == current_user) %>
Something
<% end %>
<% end %>
<% end %>I know is not correct to have all this in my view, havng in mind that 'Something' means more code
Last edited by jtomasrl (2011-10-23 11:48:40)