---
title: The URL Police
teaser:
tags: web
author: Matt Jankowski
published_on: 2007-11-14
---

![''](http://images.thoughtbot.com/ui/2007-11-14-5012.jpg)

I think we can all agree that seeing a form (like search, for example) which is
going to send a message in a bottle, or even as part of a GET request should not
include that dirtiest of url params &mdash; commit=Submit or commit=Go.

When you send your SOS to the world, you want it be to be nice and clean, don't
you?  I mean, if a year has passed since you wrote your note...well, it's time
restart your mongrels.

Doing a GET to `/messages/search?query=SOS&to=TheWorld` is ok ... but
`/messages/search?query=SOS&to=TheWorld&commit=Submit` should not stand.

So here is a short GR reader survey.  When dealing with this default markup...

```html
<input name="commit" type="submit" value="Submit" />
```

...which solution to removing the name=commit do you take?

Are you simple?

```erb
    <%= submit_tag 'Submit', :name => '' %>
```

Are you precise?

```erb
<%= submit_tag 'Submit', :name => nil %>
```

Have you gone overboard?

```erb
<%= submit_tag 'Submit', :name => String.new %>
```

Have you lost your mind? (note that this doesn't actually work but I think we'd
all love it if it did)

```erb
<%= submit_tag 'Submit', :name => NilClass.new %>
```

Or, are you enterprise?

```erb
<%= submit_tag 'Submit', :name => submit_input_name %>

helper_method :submit_input_name
def submit_input_name
  @_submit_input_name ||= nil
end
```

Well, what are you?
