mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
more style fixes
This commit is contained in:
parent
1c1391c69e
commit
e06e0a5ca3
8 changed files with 134 additions and 114 deletions
|
|
@ -1,44 +1,46 @@
|
|||
class Admin::ContactsController < ApplicationController
|
||||
before_action :set_conference
|
||||
before_action :set_contact, only: [:show, :edit, :update, :destroy]
|
||||
module Admin
|
||||
class ContactsController < ApplicationController
|
||||
before_action :set_conference
|
||||
before_action :set_contact, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /:conference/contact
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /:conference/contact/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# PATCH/PUT /:conference/contact
|
||||
def update
|
||||
if @contact.update(contact_params)
|
||||
redirect_to admin_conference_contact_path, notice: 'Contact details were successfully updated.'
|
||||
else
|
||||
render :edit
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /:conference/contact
|
||||
def destroy
|
||||
@contact.destroy
|
||||
redirect_to admin_conference_contacts_url, notice: 'Contact details were successfully destroyed.'
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_contact
|
||||
@contact = @conference.contact
|
||||
# GET /:conference/contact
|
||||
def show
|
||||
end
|
||||
|
||||
def set_conference
|
||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||
# GET /:conference/contact/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# Only allow a trusted parameter "white list" through.
|
||||
def contact_params
|
||||
# params.require(:contact).permit(:social_tag, :email, :facebook, :googleplus, :twitter, :instagram, :public)
|
||||
params[:contact]
|
||||
# PATCH/PUT /:conference/contact
|
||||
def update
|
||||
if @contact.update(contact_params)
|
||||
redirect_to admin_conference_contact_path, notice: 'Contact details were successfully updated.'
|
||||
else
|
||||
render :edit
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /:conference/contact
|
||||
def destroy
|
||||
@contact.destroy
|
||||
redirect_to admin_conference_contacts_url, notice: 'Contact details were successfully destroyed.'
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_contact
|
||||
@contact = @conference.contact
|
||||
end
|
||||
|
||||
def set_conference
|
||||
@conference = Conference.find_by(short_title: params[:conference_id])
|
||||
end
|
||||
|
||||
# Only allow a trusted parameter "white list" through.
|
||||
def contact_params
|
||||
# params.require(:contact).permit(:social_tag, :email, :facebook, :googleplus, :twitter, :instagram, :public)
|
||||
params[:contact]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue