Class: Nightlight::ActivitiesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/nightlight/activities_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/nightlight/activities_controller.rb', line 7

def create
  @status = @page.activities.status.new activity_params
  @status.user = current_user
  if @status.save
    flash[:success] = "Status updated."
    redirect_to page_url(@page)
  else
    flash.now[:error] = @status.errors.full_messages.first
    render 'nightlight/pages/show'
  end
end