On 17 Mar., 10:18, Colin Law <[email protected]> wrote:
> 2009/3/17 [email protected] <[email protected]>
>
>
>
>
>
>
>
> > On 17 Mar., 07:31, Andrew Timberlake <[email protected]>
> > wrote:
> > > I just add a link next to the submit tag labelled 'cancel' with a link
> > > to an appropriate page.
> > > Technically a button should be used for an action while cancelling is
> > > technically the absence of an action.
>
> > I totally agree. Using a link instead of a button has several
> > advantages. That the user does not expect anything destructive to
> > happen when clicking a link, is one. And you don't need to clutter
> > your controller with logic for the cancel button. The only thing you
> > need is a simple #link_to refering to an appropriate page.
>
> At the risk of being contentious, I suggest that the above are non-Railsy
> answers.  It may be strictly correct to say that Cancel is an instruction to
> do nothing and should not therefore be a button.  Millions of people,
> however,  are used to seeing cancel buttons all over the place and expect it
> to throw away any data they have entered on a form and ensure that they have
> done no harm.  Rails stresses the importance of following conventions and
> should therefore follow this convention and not try to enforce
> unconventional ideas on the user.
>
> In fact as I think about it, a Cancel button does take some action (at least
> from the users perspective, which is what matters), it discards any data he
> has entered into the form.  The fact that this is a do-nothing action in the
> Rails code is irrelevant to what the user interface should be.

Well, I can see what you mean. I do not want to discuss it further,
just wanted to mention that you could use the #button_to method to
avoid cluttering your controller. Problem is, you need to put it
outside the form since the method outputs a <form> itself.

--
Cheers,
David Knorr
http://twitter.com/rubyguy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to