Class: SnippetsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/snippets_controller.rb

Overview

Controller for CRUDing snippets.

Instance Method Summary collapse

Instance Method Details

#newObject


5
6
7
8
9
10
11
12
# File 'app/controllers/snippets_controller.rb', line 5

def new
  if user_signed_in?
    render 'snippets/new'
  else
    # To avoid flash message
    redirect_to new_user_session_path
  end
end