Adding Turbolinks, adding status posting form on homepage
This commit is contained in:
parent
c28971c70c
commit
f14f462eaf
14 changed files with 104 additions and 2 deletions
18
app/controllers/statuses_controller.rb
Normal file
18
app/controllers/statuses_controller.rb
Normal file
|
@ -0,0 +1,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
|
Loading…
Add table
Add a link
Reference in a new issue