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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4005a47a8f2ceee49670b920593c1d52?d=identicon&s=25 Ben Munat (Guest)
on 2006-02-19 04: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, @proposal.id%>
     <%= submit_tag "Remove Vote", 'class' => "button" %>
     <%= end_form_tag %>
     <% else %>
     <%= start_form_tag :action => "add_vote" %>
     <%= hidden_field_tag :id, @proposal.id%>
     <%= submit_tag "Vote For Proposal", 'class' => "button" %>
     <%= end_form_tag %>
     <% end %>
</div>

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

b
This topic is locked and can not be replied to.