Commit 4a6be178332fe0c86a2de9f45dd5b78954ee9d09

Authored by MoisesMachado
1 parent ca0593f6

ActionItem12: fixed some things in the acceptance of the terms of use


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@426 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/account_controller.rb
@@ -27,7 +27,7 @@ class AccountController < ApplicationController @@ -27,7 +27,7 @@ class AccountController < ApplicationController
27 def signup 27 def signup
28 begin 28 begin
29 @terms_of_use = virtual_community.terms_of_use 29 @terms_of_use = virtual_community.terms_of_use
30 - terms_accepted = params[:user].delete(:terms_accepted) 30 + terms_accepted = params[:user] ? params[:user].delete(:terms_accepted) : false
31 @user = User.new(params[:user]) 31 @user = User.new(params[:user])
32 return unless request.post? 32 return unless request.post?
33 if @terms_of_use and !terms_accepted 33 if @terms_of_use and !terms_accepted
app/views/account/signup.rhtml
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 16
17 <% if @terms_of_use %> 17 <% if @terms_of_use %>
18 <p> <%= @terms_of_use %> </p> 18 <p> <%= @terms_of_use %> </p>
19 - <p> <%= check_box 'user', 'terms_accepted' %> 19 + <p> <%= check_box_tag 'user[terms_accepted]' %>
20 <label for="terms_accepted">I accept the terms of use</label> </p> 20 <label for="terms_accepted">I accept the terms of use</label> </p>
21 <% end %> 21 <% end %>
22 22