google-code-export / globalite

Automatically exported from code.google.com/p/globalite
1 stars 0 forks source link

"undefined method l" within a namespace #34

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. script/generate controller Admin::users 
2. translate something in the admin/new.html.erb
3. translation fails, method not found

Everything is working fine, but not in namespaced context.

Any Idea?

Thanks!

Original issue reported on code.google.com by beyoume...@gmail.com on 22 Jun 2008 at 10:51

GoogleCodeExporter commented 9 years ago
I found out, that, this doesn't work (the scope doesn't know anything about the 
method)
<%= f.error_messages %>
so you need to use still this 
<%= error_messages_for :user %>

Original comment by beyoume...@gmail.com on 22 Jun 2008 at 11:16

GoogleCodeExporter commented 9 years ago
This is really ugly.

Somewhere the l() method is called on a String which fails. Looks like in some 
older
rails version a Symbol was returned and probably with rails 2.1 it's now a 
string? (I
assume it's just the name of the model)

ugly workaround:

class String
  def l(value)
    value.to_sym.l
  end
end

Original comment by rmo...@gmail.com on 24 Jul 2008 at 7:34