Ruby on Rails Saturday, July 27, 2013

On 27 July 2013 06:46, muthu b. <lists@ruby-forum.com> wrote:
>>> NoMethodError (undefined method `config_value' for nil:NilClass):
>>> app/controllers/application_controller.rb:319:in `set_user_language'
>
>
> Colin please guide me to solve the error.
>
> These are the lines from 310 to 325 in my application_controller.rb
>
> return @local_tzone_time
> end
>
> private
> def set_user_language
> lan = Configuration.find_by_config_key("Locale")
> I18n.default_locale = :en
> Translator.fallback(true)
> if session[:language].nil?
> I18n.locale = lan.config_value

As I said you are calling config_value on a variable that is nil. Sol
lan is nil. Presumably the call of
Configuration.find_by_config_key("Locale") is not finding the key. I
imagine there is a fedina config file you have to setup that should
contain a Locale setting.

Colin

> else
> I18n.locale = session[:language]
> end
> News.new.reload_news_bar
> end
> end
>
>
> My first thing is to solve errors in my installation. i am learning
> rails but i am not able to solve the errors occur in my installation.
> the fedena forum is not replying for my errors. so please guide me to
> solve the errors.
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8fe2a06638324c126bbd7974c1076ffb%40ruby-forum.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvAJrkgyUXaiSEnXWaJ1yF3i1nJV01WU1hc7nU9hBJQCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment