Sha256: 6a90d41ea0a01071d6eee5119c1d57bafada22da4ec6d412b3573d186f346dd0

Contents?: true

Size: 635 Bytes

Versions: 6

Compression:

Stored size: 635 Bytes

Contents

# frozen_string_literal: true

module Thredded
  class MessageboardGroupsController < Thredded::ApplicationController
    def new
      @messageboard_group = MessageboardGroup.new
      authorize @messageboard_group, :create?
    end

    def create
      @messageboard_group = MessageboardGroup.new(messageboard_group_params)
      authorize @messageboard_group, :create?

      if @messageboard_group.save
        redirect_to root_path
      else
        render action: :new
      end
    end

    private

    def messageboard_group_params
      params
        .require(:messageboard_group)
        .permit(:name)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
thredded-0.6.2 app/controllers/thredded/messageboard_groups_controller.rb
thredded-0.6.1 app/controllers/thredded/messageboard_groups_controller.rb
thredded-0.6.0 app/controllers/thredded/messageboard_groups_controller.rb
thredded-0.5.1 app/controllers/thredded/messageboard_groups_controller.rb
thredded-0.5.0 app/controllers/thredded/messageboard_groups_controller.rb
thredded-0.4.0 app/controllers/thredded/messageboard_groups_controller.rb