Validate against spaces


#1

How would I go about validating against spaces (for urls)
Instead I wish to use dashes.


#2

You might want to clarify your question a bit more if you want a useful
answer.

What data are you trying to validate, and where?


#3

Luke R. wrote:

You might want to clarify your question a bit more if you want a useful
answer.

What data are you trying to validate, and where?

I’d like to validate urls without any spaces:
So this wouldn’t be allowed ‘new page’
But this would ‘new-page’


#4

Is the url a field in an ActiveRecord object?


#5

Richard W. wrote:

Is the url a field in an ActiveRecord object?

yes

I was thinking along the lines of
validates_format_of :url, :with => ‘ect’