This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
admin = User.create! :first_name => 'admin', :last_name => 'admin', :email => '[email protected]', :mobile => '9999911111', :locality => 'Goregaon', :city => 'Mumbai', :user_type => 'admin', :username => '[email protected]', :password => 'admin' | |
franchisee = User.create! :first_name => 'franchisee', :last_name => 'franchisee', :email => '[email protected]', :mobile => '9999911111', :locality => 'Goregaon', :city => 'Mumbai', :user_type => 'franchisee', :username => '[email protected]', :password => 'franchisee' | |
franchisee.parent = admin | |
franchisee.save! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
before_action :require_login | |
private | |
def check_user | |
if not request.headers["user_id"].empty? | |
def self.get_user | |
Users.get({id => request.headers["user_id"]}) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl http://localhost:3000/users -d "{'user': {'firstName': 'Abhishek', 'loginInfo':{'password':'p'}}}" |
NewerOlder