On Tue, Oct 10, 2006, Dark A. wrote:
I googled around on this one but found nothing. Anyone know what these
error means ?
It means exactly what the exception says. You can’t call gsub on a
I’m trying to use it in a form field :
<%= text_field(:search,:city.gsub(/\s/, “’’”)) %>
That doesn’t do what you think it does.
text_field takes two arguments, the first is the object it represents,
and the second is the attribute of that object that the value will be
saved into/pulled out from.
It seems that you want to massage that value before it gets inserted
into the form field, right? Or is it after it gets saved?
In the former case, you can (probably!) specify a value manually, like
<%= text_field :search, :city, :value => @search[:city].gsub(/\s/, “’’”)
In the latter case, do this in your model.