SHARE
TWEET

Untitled

a guest Mar 10th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class CheckinController < ApplicationController
  2.     def index
  3.         @checkin = Checkin.find(:last)
  4.         puts "################## "
  5.         puts current_user.id
  6.     end
  7.    
  8.     def new
  9.         @checkin = Checkin.find(:last)
  10.         @questions = @checkin.checkin_questions.all(:order => "id")
  11.         puts "################## "
  12.         puts current_user.id
  13.     end
  14.    
  15.     def create
  16.         @checkin = Checkin.find(:last)
  17.         @check = Check.new
  18.         puts "################## "
  19.         puts current_user.id #retorna nil
  20.         @check.user_id = current_user.id
  21.         @check.checkin_id = @checkin.id
  22.        
  23.         respond_to do |format|
  24.             if @check.save
  25.                 format.html # create.html.erb
  26.             else
  27.                 format.html { render :action => "new", notice: 'error' }
  28.             end
  29.         end
  30.     end
  31. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top