mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 22:21:11 +00:00
commit
e8b9c26778
19 changed files with 606 additions and 44 deletions
|
|
@ -27,9 +27,15 @@ class Admin::ConferenceController < ApplicationController
|
|||
|
||||
def update
|
||||
@conference = Conference.find_by(short_title: params[:id])
|
||||
@conference.update_attributes(params[:conference])
|
||||
flash[:notice] = "Updated Conference"
|
||||
redirect_to(admin_conference_path(:id => @conference.short_title), :notice => 'Conference was successfully updated.')
|
||||
short_title = @conference.short_title
|
||||
if @conference.update_attributes(params[:conference])
|
||||
redirect_to(admin_conference_path(id: @conference.short_title),
|
||||
notice: 'Conference was successfully updated.')
|
||||
else
|
||||
errors = @conference.errors.full_messages.join('! ')
|
||||
redirect_to(admin_conference_path(id: short_title),
|
||||
flash: { error: "Conference update failed. #{errors}" })
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
@ -37,7 +43,7 @@ class Admin::ConferenceController < ApplicationController
|
|||
@conference = Conference.find_by(short_title: params[:id])
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render :json => @conference.to_json }
|
||||
format.json { render json: @conference.to_json }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def after_sign_in_path_for(resource)
|
||||
if not session[:return_to].start_with?(user_registration_path)
|
||||
if session[:return_to] &&
|
||||
!session[:return_to].start_with?(user_registration_path)
|
||||
logger.debug "Returning to #{session[:return_to]}"
|
||||
session[:return_to]
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue