Not Included in list Error - Rails -


so, have en , es supported locales in application.. default locale en. when try change locale in console , save object, error saying locale not included in list... while validating locale, have included :inclusion attribute.. refers file locale stored...any idea error might be?

i tried changing locale in gui.. works. if can change in gui, should able same in rails console well... articles saw "not included in list" led me :include attribute , whatever try, if give

:inclusion { :in => %(en es) } 

it gives same error :|

you using wrong syntax hash. try

validates :my_field, :inclusion => { :in => %w(en es) } 

i prefer %w[en es] on parenthesis. both fine :)


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -