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.


Popular posts from this blog

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

SELECT COUNTRY WITH STATE AND IT'S CITIES RAILS

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

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.

DEPLOYING PROJECT USING CAPISTRANO (CAPISTRANO IN RAILS)