How I can check on models controller if item has space on it and if
yes then return error ?
ie. on form you have textbox myitem and if users fills in there like:
xxx yyyy (ie. space on middle or end of value)
then this should return an error saying that no space is allowed on
that field ?
Jep I got it
validates_format_of :intname, :with => /^[a-zA-Z0-9]*?$/, :message =>
name can only contain letters & numbers and nospaces'
Is the problem that the regex validation is working correctly but you
do not know that in the controller?
You should be able to:
@model = Model.new(params[:model])
... send your formatting message here ...