working ember... again
This commit is contained in:
@@ -72,6 +72,9 @@ private
|
||||
helper_method :event_host
|
||||
|
||||
def show_404
|
||||
render 'dashboard/404', layout: true, status: 404
|
||||
respond_to do |format|
|
||||
format.html { render 'dashboard/404', layout: true, status: 404}
|
||||
format.json { render json: {ok: false}, status: 404 }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -33,7 +33,11 @@ module Suppliers
|
||||
respond_to do |format|
|
||||
format.html {}
|
||||
format.json do
|
||||
render json: @list
|
||||
if params[:old_style] then
|
||||
render json: @list.with_orders_as_json
|
||||
else
|
||||
render json: @list
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,9 +5,16 @@ module Suppliers
|
||||
# GET /sections.json
|
||||
def index
|
||||
@sections = current_supplier.sections
|
||||
@sections.include_relation(:table)
|
||||
@active_lists = current_supplier.active_lists
|
||||
@sections.include_relation(:tables)
|
||||
@active_lists = List.active_for_supplier(current_supplier.id)
|
||||
@active_table_ids = @active_lists.map(&:table_id).compact
|
||||
for section in @sections
|
||||
for table in section.tables
|
||||
if active_list = @active_lists.find{|l| l.table_id == table.id}
|
||||
table.active_list = active_list
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
||||
def passthru
|
||||
show_404
|
||||
# Or alternatively,
|
||||
# raise ActionController::RoutingError.new('Not Found')
|
||||
end
|
||||
|
||||
def facebook
|
||||
@user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user)
|
||||
|
||||
if @user.persisted?
|
||||
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook"
|
||||
binding.pry
|
||||
redirect_to user_root_path, :event => :authentication, :current_user => @user
|
||||
else
|
||||
session["devise.facebook_data"] = request.env["omniauth.auth"]
|
||||
redirect_to new_user_registration_url
|
||||
end
|
||||
end
|
||||
|
||||
def failure(env = {})
|
||||
binding.pry
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user