This repository has been archived on 2024-08-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
redstoner.com/app/controllers/forumgroups_controller.rb
2013-10-21 05:47:49 +02:00

45 lines
760 B
Ruby

class ForumgroupsController < ApplicationController
def index
redirect_to forums_path
end
def show
redirect_to forums_path + "#forums-#{params[:id]}"
end
def edit
end
def update
end
def new
if admin?
@group = Forumgroup.new
else
flash[:alert] = "You are not allowed to create forums."
redirect_to forums_path
end
end
def create
if admin?
@group = Forumgroup.new(params[:forumgroup])
if @group.save
flash[:notice] = "Forums created."
redirect_to @group
else
flash[:alert] = "Something went wrong"
render :new
end
else
flash[:alert] = "You are not allowed to create forums."
redirect_to forums_path
end
end
end