Class: MongoidForums::Admin::ForumsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/mongoid_forums/admin/forums_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
18
# File 'app/controllers/mongoid_forums/admin/forums_controller.rb', line 10

def create
  if @forum = Forum.create(name: params[:forum][:name], category: params[:forum][:category])
    flash[:notice] = "Category created successfully"
    redirect_to @forum
  else
    flash.now.alert = "Category could not be created"
    render :action => "new"
  end
end

#destroyObject



26
27
# File 'app/controllers/mongoid_forums/admin/forums_controller.rb', line 26

def destroy
end

#editObject



20
21
# File 'app/controllers/mongoid_forums/admin/forums_controller.rb', line 20

def edit
end

#newObject



6
7
8
# File 'app/controllers/mongoid_forums/admin/forums_controller.rb', line 6

def new
  @forum = Forum.new
end

#updateObject



23
24
# File 'app/controllers/mongoid_forums/admin/forums_controller.rb', line 23

def update
end