Forum: Ruby on Rails looking for more idiomatic way of doing this

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ben M. (Guest)
on 2006-02-19 05:10
(Received via mailing list)
I have proposals and members can vote for them. In my proposal view I
have a little div
where the currently logged in member can vote:

<div id="vote_div" class="vote">
     Your vote:
     <% if @member_vote %>
     You have voted for this proposal<br />
     <%= start_form_tag :action => "delete_vote" %>
     <%= hidden_field_tag :id,>
     <%= submit_tag "Remove Vote", 'class' => "button" %>
     <%= end_form_tag %>
     <% else %>
     <%= start_form_tag :action => "add_vote" %>
     <%= hidden_field_tag :id,>
     <%= submit_tag "Vote For Proposal", 'class' => "button" %>
     <%= end_form_tag %>
     <% end %>

This works but is kind of ugly. Wondering if anyone has any more
rails-idiomatic way of
doing this?

This topic is locked and can not be replied to.