0

在我的控制器中,我有:

@cabs_city = VwVolsCabs.all

@cabs_city = @cabs_city.each { |s| s.gsub! /[^[:alnum:]]/, '' }

看法:

<% @cabs_city.each do |s| %>
    <%= s.cab_name %>
<% end %>

但我有这个错误:

NoMethodError (undefined method `gsub!' for #<VwVolsCabs:0x000000089e8dd0>):
4

1 回答 1

1

控制器:

@cabs_city = VwVolsCabs.all
@cabs_city.each { |s| s.cab_name.gsub! /[^[:alnum:]]/, '' }
于 2013-07-24T07:45:05.747 回答