mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-24 00:54:02 -05:00
17 lines
349 B
Ruby
17 lines
349 B
Ruby
class StatusesController < ApplicationController
|
|
before_action :authenticate_user!
|
|
|
|
def create
|
|
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
|