app/controllers/users/open_authentications_controller.rb
# No route at the moment since we're calling it directly from the new action.
No route at the moment since we're calling it directly from the new action.
No route at the moment since we ' re calling it directly from the new action .
def create
    if request.get? && params[:action] == 'new'
      open_authentication = @user.open_authentications.build(@open_auth.authentication_attributes.merge(verified_at: Time.now))
      if open_authentication.save
        flash[:notice] = I18n.t(:new_authentication_added,
                                scope: [:users, :open_authentications, :notices, @open_auth.provider.to_sym])
      else
        flash[:error] = I18n.t(:new_authentication_not_added,
                               scope: [:users, :open_authentications, :errors, @open_auth.provider.to_sym])
      end
    end
    redirect_to user_open_authentications_url(@user)
  end
def create if request . get? && params [ :action ] == 'new' open_authentication = @user . open_authentications . build ( @open_auth . authentication_attributes . merge ( verified_at : Time . now ) ) if open_authentication . save flash [ :notice ] = I18n . t ( :new_authentication_added , scope : [ :users , :open_authentications , :notices , @open_auth . provider . to_sym ] ) else flash [ :error ] = I18n . t ( :new_authentication_not_added , scope : [ :users , :open_authentications , :errors , @open_auth . provider . to_sym ] ) end end redirect_to user_open_authentications_url ( @user ) end
No route at the moment since we're calling it directly from the new action.
No route at the moment since we ' re calling it directly from the new action .