Using Globalize is great, however if you planning / using Globalize (ModelTranslation) in application with Rails 2.0 you may impair this problem:
Argument error "wrong number of arguments (2 for 1)
while you updating your model data, like @order.update_attributes(params[:order])
All what you need to do is go to /vendor/plugins/globalize/lib/globalize/localization directory, open db_translate.rb file, goto line ~675 (of find def attributes_with_quotes method)
and replace whole def with that:
def attributes_with_quotes(include_primary_key = true, include_readonly_attributes = true)
if Locale.base?
quoted = attributes.inject({}) do |quoted, (name, value)|
if column = column_for_attribute(name)
quoted[name] = quote_value(value, column) unless !include_primary_key && column.primary
end
quoted
end
else
quoted = attributes.inject({}) do |quoted, (name, value)|
if !self.class.globalize_facets_hash.has_key?(name) &&
column = column_for_attribute(name)
quoted[name] = quote_value(value, column) unless !include_primary_key && column.primary
end
quoted
end
end
include_readonly_attributes ? quoted : remove_readonly_attributes(quoted)
end
Original fix by artemv
5 comments:
thank you!!
i glad that its helps :)
thanks a lot -- you saved my sunday :-)
Using rails development how to localize or globalize models field names, table names, and error messages.
Do you asking ?
Post a Comment