class Public::EntreprisesController < ApplicationController layout "public" def new #@page = Page.find(94) @entreprise = Entreprise.new end def create #@page = Page.find(94) if Entreprise.find_by_email(params[:entreprise][:email]) session[:auth] = true redirect_to session[:prev_page] else @entreprise= Entreprise.new(params.require(:entreprise).permit!) if @entreprise.save session[:auth] = true redirect_to session[:prev_page] else render :action => :new end end end end