2014-05-26 13:51:03 +05:30
|
|
|
class Admin::OrganizationsController < ApplicationController
|
|
|
|
|
before_filter :verify_organizer
|
|
|
|
|
respond_to :html
|
|
|
|
|
|
|
|
|
|
def index
|
|
|
|
|
@organizations = Organization.all
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def new
|
|
|
|
|
@organization = Organization.new
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def create
|
|
|
|
|
@organization = Organization.new(params[:organization])
|
|
|
|
|
flash[:notice] = 'Organization was successfully created.' if @organization.save
|
2014-05-26 15:43:19 +05:30
|
|
|
respond_with @organization, location: admin_organizations_path
|
2014-05-26 13:51:03 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def show
|
|
|
|
|
@organization = Organization.find(params[:id])
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def edit
|
|
|
|
|
@organization = Organization.find(params[:id])
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def update
|
|
|
|
|
@organization = Organization.find(params[:id])
|
2014-05-26 15:48:20 +05:30
|
|
|
flash[:notice] = 'Organization was successfully updated'
|
|
|
|
|
if @organization.update_attributes(params[:organization])
|
2014-05-26 15:43:19 +05:30
|
|
|
respond_with @organization, location: admin_organizations_path
|
2014-05-26 13:51:03 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def delete
|
|
|
|
|
@organization = Organization.find(params[:id])
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
|
@organization = Organization.find(params[:id])
|
|
|
|
|
@organization.destroy
|
2014-05-26 15:43:19 +05:30
|
|
|
redirect_to admin_organizations_path, notice: 'Organization got deleted'
|
2014-05-26 13:51:03 +05:30
|
|
|
|
2014-05-26 15:43:19 +05:30
|
|
|
end
|
2014-05-26 13:51:03 +05:30
|
|
|
end
|