Skip to content
Extraits de code Groupes Projets
Valider 20b8c11c rédigé par echarp's avatar echarp
Parcourir les fichiers

Après création d'événement redirection vers :root

parent 1a2945fc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -40,6 +40,7 @@ public/refinery/* ...@@ -40,6 +40,7 @@ public/refinery/*
# Vendor Cache # Vendor Cache
vendor/cache vendor/cache
vendor/bundle
# Acts as Indexed # Acts as Indexed
index/**/* index/**/*
......
...@@ -41,7 +41,7 @@ class EventsController < ApplicationController ...@@ -41,7 +41,7 @@ class EventsController < ApplicationController
def create def create
@event = Event.new(event_params) @event = Event.new(event_params)
# This is a special case, required to handle the region attribute with same foreign key name # This is a special case, required to handle the region attribute with same foreign key name
@event.region = Region.find(params[:event][:region]) @event.region = Region.find params[:event][:region]
if params[:visu] if params[:visu]
@event.valid? @event.valid?
...@@ -56,7 +56,7 @@ class EventsController < ApplicationController ...@@ -56,7 +56,7 @@ class EventsController < ApplicationController
# Send a mail to moderators # Send a mail to moderators
ModerationMailer.create(@event).deliver ModerationMailer.create(@event).deliver
format.html { redirect_to @event, notice: t('.ok') } format.html { redirect_to :root, notice: t('.ok') }
format.json { render action: 'show', status: :created, location: @event } format.json { render action: 'show', status: :created, location: @event }
else else
format.html { render action: 'new' } format.html { render action: 'new' }
...@@ -117,8 +117,8 @@ class EventsController < ApplicationController ...@@ -117,8 +117,8 @@ class EventsController < ApplicationController
end end
def check_secret def check_secret
if (params[:secret] != @event.secret) if params[:secret] != @event.secret
redirect_to @event, notice: t(:forbidden, scope: [:events, :edit]) redirect_to :root, notice: t(:forbidden, scope: [:events, :edit])
end end
end end
......
- if request.format == 'text/html' && controller.controller_name != 'moderations' && controller.controller_name != 'notes' && controller.action_name != 'edit' - if request.format == 'text/html' && controller.controller_name != 'moderations' && controller.controller_name != 'notes' && controller.action_name != 'edit' && controller.action_name != 'cancel'
#lug-list #lug-list
%h1=t '.lug-list' %h1=t '.lug-list'
- if @event.region - if @event.region
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter