about summary refs log tree commit diff
path: root/app/controllers/statuses_controller.rb
blob: a5cb3eae154a6bab82ef27f4d3a57fea7847cb44 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class StatusesController < ApplicationController
  layout 'dashboard'

  before_action :authenticate_user!

  def create
    status = PostStatusService.new.(current_user.account, status_params[:text])
    redirect_to root_path
  rescue ActiveRecord::RecordInvalid
    redirect_to root_path
  end

  private

  def status_params
    params.require(:status).permit(:text)
  end
end