Class: Admin::ForumsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/my_forum/admin/forums_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



20
21
22
23
# File 'app/controllers/my_forum/admin/forums_controller.rb', line 20

def create
  @forum = @forum_category.forums.build(forum_params)
  @forum.save ? redirect_to(admin_forums_path) : raise('forum not created')
end

#indexObject



12
13
14
# File 'app/controllers/my_forum/admin/forums_controller.rb', line 12

def index
  @categories = Category.all
end

#newObject



16
17
18
# File 'app/controllers/my_forum/admin/forums_controller.rb', line 16

def new
  @forum = @forum_category.forums.build
end