Class UsersController
In: app/controllers/users_controller.rb
Parent: ApplicationController

Methods

index   new  

Public Instance methods

[Source]

    # File app/controllers/users_controller.rb, line 5
 5:   def index
 6:     @questions = questions
 7:     votes = Pairwise.list_votes(nil, nil, 100)
 8:     @ip_percents = ip_percents(votes, false)
 9:     @label = t('items.total')
10:     @explain = t('user.map_explanation')
11:   end

[Source]

    # File app/controllers/users_controller.rb, line 13
13:   def new
14:     @header = true
15:     if request.post?
16:        @user = User.new(params[:user])
17:        if @user.valid?
18:         Pairwise.server(PAIRWISE_PARAMS)
19:         if Pairwise.user(@user.email, @user.email, @user.password).first.to_i > 0
20:           # successfully created user
21:           set_user(@user.email, @user.password)
22:           @user.save
23:           redirect_to new_question_path
24:         else
25:           flash.now[:error] = t('error.pairwise_error')
26:         end
27:        end
28:     end
29:   end

[Validate]