This repository has been archived on 2019-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/app/controllers/statuses_controller.rb

19 lines
371 B
Ruby
Raw Normal View History

class StatusesController < ApplicationController
layout 'dashboard'
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