Class: Api::V1::NoteTypesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/api/v1/note_types_controller.rb

Instance Method Summary collapse

Instance Method Details

#index ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/api/v1/note_types_controller.rb', line 5

def index
  NoteType.include_root_in_json = false

  if params[:ids]

    render json: {note_types: NoteType.where(id: params[:ids].split(',')).all}
  else

    render json: {success: true, note_types: NoteType.all}
  end
end

#show ⇒ Object



17
18
19
20
21
22
23
# File 'app/controllers/api/v1/note_types_controller.rb', line 17

def show
  NoteType.include_root_in_json = false

  note_type = NoteType.find(params[:id])

  render json: {success: true, note_type: note_type}
end