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.

18 lines
371 B

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