I use a filter -
before_filter :check_for_cancel, :only => [:create, :update]
and a method
def check_for_cancel
if params[:commit] == 'Cancel'
redirect_back_or_default.......
end
end
<%= submit_tag 'Any Label', :name => 'cancel' %>
and
def check_for_cancel
unless params[:cancel].blank?
redirect_back_or_default.......
end
end
you can avoid that.
Andrew Porter wrote:
>
> I use a filter -
> before_filter :check_for_cancel, :only => [:create, :update]
>
> and a method
>
> def check_for_cancel
> if params[:commit] == 'Cancel'
> redirect_back_or_default.......
> end
> end
--
Posted via http://www.ruby-forum.com/.