Some updates to translation engine, added dotenv but have not yet set it up.
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
# Prevent CSRF attacks by raising an exception.
|
||||
# For APIs, you may want to use :null_session instead.
|
||||
protect_from_forgery with: :exception
|
||||
# Prevent CSRF attacks by raising an exception.
|
||||
# For APIs, you may want to use :null_session instead.
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
before_filter :capture_page_info
|
||||
|
||||
def capture_page_info
|
||||
$page_info = {:path => request.env['PATH_INFO'], :controller => params['controller'], :action => params['action']}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
include ApplicationHelper
|
||||
|
||||
class OrganizationsController < ApplicationController
|
||||
before_action :set_organization, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
@@ -17,6 +19,10 @@ class OrganizationsController < ApplicationController
|
||||
@organization = Organization.new
|
||||
#@organization.location = Location.new
|
||||
@organization.locations.build
|
||||
@user_location = lookup_ip_location
|
||||
@organization.locations[0].city = @user_location.city
|
||||
@organization.locations[0].country = @user_location.country_code
|
||||
@organization.locations[0].territory = @user_location.state_code
|
||||
@organization.locations_organization.build
|
||||
@organization.user_organization_relationships.build
|
||||
end
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
class UserSessionsController < ApplicationController
|
||||
def new
|
||||
session[:return_to] ||= request.referer
|
||||
session[:return_to] ||= request.referer
|
||||
@user = User.new
|
||||
end
|
||||
|
||||
def create
|
||||
if @user = login(params[:email], params[:password])
|
||||
#redirect_back_or_to(:users, notice: 'Login successful')
|
||||
redirect_to session.delete(:return_to)
|
||||
redirect_to session.delete(:return_to) || 'pages#home'
|
||||
else
|
||||
flash.now[:alert] = "Login failed"
|
||||
render action: "new"
|
||||
|
||||
Reference in New Issue
Block a user