stas

Ruby code posted by stas
created at 22 Sep 09:28

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 def new_idea
   @idea = Idea.create(header: params[:header], body: params[:body], video: params[:video], user_id: @current_user.id)
    
   render layout: false
  end
  
  def set_session
      
      req = request.env['omniauth.auth']
      user = User.where(provider: req.provider, uid: req.uid).first 
      unless user
          
        user =  User.create(name: req.info.name, provider: req.provider, uid: req.uid)
      end
        session[:user_id] = user.id
     redirect_to root_url
  end 
516 Bytes in 5 ms with coderay