You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.9 KiB
59 lines
1.9 KiB
11 years ago
|
class UserOrganizationRelationshipsController < ApplicationController
|
||
|
before_action :set_user_organization_relationship, only: [:show, :edit, :update, :destroy]
|
||
|
|
||
|
# GET /user_organization_relationships
|
||
|
def index
|
||
|
@user_organization_relationships = UserOrganizationRelationship.all
|
||
|
end
|
||
|
|
||
|
# GET /user_organization_relationships/1
|
||
|
def show
|
||
|
end
|
||
|
|
||
|
# GET /user_organization_relationships/new
|
||
|
def new
|
||
|
@user_organization_relationship = UserOrganizationRelationship.new
|
||
|
end
|
||
|
|
||
|
# GET /user_organization_relationships/1/edit
|
||
|
def edit
|
||
|
end
|
||
|
|
||
|
# POST /user_organization_relationships
|
||
|
def create
|
||
|
@user_organization_relationship = UserOrganizationRelationship.new(user_organization_relationship_params)
|
||
|
|
||
|
if @user_organization_relationship.save
|
||
|
redirect_to @user_organization_relationship, notice: 'User organization relationship was successfully created.'
|
||
|
else
|
||
|
render action: 'new'
|
||
|
end
|
||
|
end
|
||
|
|
||
|
# PATCH/PUT /user_organization_relationships/1
|
||
|
def update
|
||
|
if @user_organization_relationship.update(user_organization_relationship_params)
|
||
|
redirect_to @user_organization_relationship, notice: 'User organization relationship was successfully updated.'
|
||
|
else
|
||
|
render action: 'edit'
|
||
|
end
|
||
|
end
|
||
|
|
||
|
# DELETE /user_organization_relationships/1
|
||
|
def destroy
|
||
|
@user_organization_relationship.destroy
|
||
|
redirect_to user_organization_relationships_url, notice: 'User organization relationship was successfully destroyed.'
|
||
|
end
|
||
|
|
||
|
private
|
||
|
# Use callbacks to share common setup or constraints between actions.
|
||
|
def set_user_organization_relationship
|
||
|
@user_organization_relationship = UserOrganizationRelationship.find(params[:id])
|
||
|
end
|
||
|
|
||
|
# Only allow a trusted parameter "white list" through.
|
||
|
def user_organization_relationship_params
|
||
|
params.require(:user_organization_relationship).permit(:user_id, :organization_id, :relationship)
|
||
|
end
|
||
|
end
|