# Using anchor for cancel in a Form

**URL:** <https://www.ruby-forum.com/t/using-anchor-for-cancel-in-a-form/184562>\
**Category:** Ruby\
**Created:** [March 4, 2010, 3:56pm UTC](https://www.ruby-forum.com/t/using-anchor-for-cancel-in-a-form/184562 "2010-03-04T15:56:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stilgar71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@stilgar71](https://www.ruby-forum.com/u/stilgar71)\
**Post date:** [March 4, 2010, 3:56pm UTC](https://www.ruby-forum.com/t/using-anchor-for-cancel-in-a-form/184562/1 "2010-03-04T15:56:51Z")

</div>

Hi all, Looking for best practices when it comes to submitting a form  
and canceling a form in Rails.

Background:  
I am leveraging a CSS dynamic that gives hover over and an embedded Icon  
to all buttons in my application so most buttons are anchors in my  
application. Artclie on the implementation:

> **[Particletree » Rediscovering the Button Element](http://particletree.com/features/rediscovering-the-button-element/)**
>
> Particletree is the beginning of something. This place, this collection of knowledge, is a gathering of forces, a sharpening of skills.

Looking for advise on this:  
In order to keep these nice looking buttons I have to submit the form  
with an anchor and cancel with an anchor tag. Is it okay to have the  
cancel button just leave the page and go to a path or should I direct it  
to the controller and then go to the Path ? What is the best practice?  
Am I missing some kind of clean up I should be doing or is leaving the  
page acceptable ?

Code:  
%div

- form\_for @activity, :url =\> { :action =\> “update” }, :html =\> {:id  
=\>“aform”} do |f|  
= f.error\_messages  
%p  
= f.label :title  
%br  
= f.text\_field :title  
%p  
= f.label :artifact  
%br  
= f.select(:artifact, %w{HLD SRS IA})  
%p  
= f.label :milestones  
%br  
= f.select(:milestone, %w{M5 M4 M3})
