User flow updates
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
# Contact page form
|
||||
class ContactFormsController < ApplicationController
|
||||
def create
|
||||
@contact_form = Cmtool::ContactForm.new(contact_form_params)
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
class Suppliers::SessionsController < Devise::SessionsController
|
||||
class Employees::SessionsController < Devise::SessionsController
|
||||
respond_to :json
|
||||
|
||||
def create
|
||||
@@ -10,6 +10,7 @@ class Suppliers::SessionsController < Devise::SessionsController
|
||||
render json: {employee_id: current_employee.id, auth_token: current_employee.authentication_token}
|
||||
end
|
||||
|
||||
# deprecated?
|
||||
def destroy
|
||||
session[:supplier_id] = nil
|
||||
super
|
||||
@@ -0,0 +1,5 @@
|
||||
class ErrorsController < ApplicationController
|
||||
def not_found
|
||||
head :not_found # Renders an empty body with 404 status [5]
|
||||
end
|
||||
end
|
||||
@@ -1,13 +1,13 @@
|
||||
class RegistrationsController < Devise::RegistrationsController
|
||||
protected
|
||||
|
||||
#def after_sign_up_path(resource)
|
||||
#end
|
||||
|
||||
private
|
||||
|
||||
# override devise internal to allow name as sign_up param
|
||||
def sign_up_params
|
||||
params.require(resource_name).permit resource_class.authentication_keys + [:name, :password, :password_confirmation]
|
||||
end
|
||||
end
|
||||
# class RegistrationsController < Devise::RegistrationsController
|
||||
# protected
|
||||
#
|
||||
# #def after_sign_up_path(resource)
|
||||
# #end
|
||||
#
|
||||
# private
|
||||
#
|
||||
# # override devise internal to allow name as sign_up param
|
||||
# def sign_up_params
|
||||
# params.require(resource_name).permit resource_class.authentication_keys + [:name, :password, :password_confirmation]
|
||||
# end
|
||||
# end
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class Users::RegistrationsController < Devise::RegistrationsController
|
||||
def create
|
||||
devise_parameter_sanitizer.permit(:sign_up, keys: [:name])
|
||||
super
|
||||
# if resource.persisted?
|
||||
# self.response_body = nil
|
||||
# end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
class UsersController < ApplicationController
|
||||
def show
|
||||
authenticate_user!
|
||||
@user = current_user
|
||||
end
|
||||
end
|
||||
@@ -1,20 +1,20 @@
|
||||
class WaiterController < ApplicationController
|
||||
layout 'waiter'
|
||||
def index
|
||||
|
||||
end
|
||||
|
||||
def product_categories
|
||||
respond_to do |format|
|
||||
format.html { redirect_to '/waiter'}
|
||||
format.json { render json: ProductCategory.all.include_relation(:product), root: 'product_categories', each_serializer: ProductCategorySerializer }
|
||||
end
|
||||
end
|
||||
|
||||
def order_products
|
||||
@table= Table.find_by_supplier_id_and_id!(current_supplier.id, params[:table_id])
|
||||
@list = List.from_table_by_employee(@table, current_employee)
|
||||
@list.place_order products: params[:order], employee: current_employee
|
||||
render nothing: true
|
||||
end
|
||||
end
|
||||
# class WaiterController < ApplicationController
|
||||
# layout 'waiter'
|
||||
# def index
|
||||
#
|
||||
# end
|
||||
#
|
||||
# def product_categories
|
||||
# respond_to do |format|
|
||||
# format.html { redirect_to '/waiter'}
|
||||
# format.json { render json: ProductCategory.all.include_relation(:product), root: 'product_categories', each_serializer: ProductCategorySerializer }
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# def order_products
|
||||
# @table= Table.find_by_supplier_id_and_id!(current_supplier.id, params[:table_id])
|
||||
# @list = List.from_table_by_employee(@table, current_employee)
|
||||
# @list.place_order products: params[:order], employee: current_employee
|
||||
# render nothing: true
|
||||
# end
|
||||
# end
|
||||
|
||||
Reference in New Issue
Block a user