You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
349 B

  1. class StatusesController < ApplicationController
  2. before_action :authenticate_user!
  3. def create
  4. PostStatusService.new.(current_user.account, status_params[:text])
  5. redirect_to root_path
  6. rescue ActiveRecord::RecordInvalid
  7. redirect_to root_path
  8. end
  9. private
  10. def status_params
  11. params.require(:status).permit(:text)
  12. end
  13. end