SIGN UP ON FIRST PROJECT IT WILL AUTOMATICALLY LOGIN TO ANOTHER PROJECT SERVER


Sign up on first project it will automatically sign up to another project server

In first server code :-

Gemfile
        gem 'rest-client'


Controller

      def create
               # sign up on one server
               @user = User.create(name: params[:user][:name], email: params[:user][:email], password: params[:user][:password], password_confirmation: params[:user][:password_confirmation])

               # after login one server it will automatically on second server
               RestClient::Request.execute(method: :post, url: "https://ipaddress/domain/users", headers: {:params => {"user": {"name": "rohit", "email": "rohityuvasoft149@gmail.com", "password": "12345678", "password_confirmation": "12345678"}}}, verify_ssl: false)
    end
       end

In second server it will be sign up automatically.


Post a Comment

Popular posts from this blog

RAILS: UPLOADING PHOTOS VIA AMAZON S3 AND PAPERCLIP (UPLOADING FILES TO S3 IN RUBY WITH PAPERCLIP)

CARRIERWAVE - UPLOAD ANY MEDIA (AUDIO , VIDEO AND IMAGE ) FILE IN RAILS

SELECT COUNTRY WITH STATE AND IT'S CITIES RAILS

UNINITIALIZED CONSTANT PAPERCLIP::STORAGE::S3::AWS

CREATE API FOR USER SIGN UP, LOGIN AND CREATE PUBLISHER WITH CURRENT USER

HOW TO CALL RAILS API FROM SIMPLE HTML PAGE.

Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension.