I'm having trouble with validates_acceptance_of.
I have this in my user model:
validates_acceptance_of :terms, :allow_nil => false, :accept => "yes", :message => "Você deve ler e aceitar os termos de uso e a política de privacidade"
i created 2 methods on the user controller, "terms" and "privacy", just to render the corresponding views "terms.html.erb" and "privacy.html.erb"Ok, that explained, the problem i'm having is that it's always asking to login before beeing able to view it.
In my new.html.erb view (the user signup form):
(...)
<%= check_box_tag 'terms', 'yes', false%>
Eu sou maior de 14 anos e realmente li os <%= link_to "Termos de Uso", { :action => "terms", :title => 'Termos e condições' } %> e a <%= link_to " Política de Privacidade", { :action => "privacy", :title => 'Política de Privacidade' } %>
"I am older than 14 years and i really read the terms and the privacy".Nervermind the portuguese as the code looks pretty straightforward :)
Now on my user_controller i have the RESTFUL for authentication:
before_filter :not_logged_in_required, :only => [:new, :create, :terms, :privacy]
before_filter :login_required, :only => [:show, :edit, :update, :index]
Note that i already added :terms and :privacy, but it still asks for login...what am i missing here? i ran out of options to check
leave suggestions please!
thanks :D