Method: NotesController#create

Defined in:
lib/generators/jinda/templates/app/controllers/jinda_org/notes_controller.rb

#createObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/generators/jinda/templates/app/controllers/jinda_org/notes_controller.rb', line 21

def create
  @note = Note.new(
    title: $xvars["new_note"]["title"],
    body: $xvars["new_note"]["body"],
    user_id: $xvars["user_id"])
  @note.save!
  # if @note.save!
  #   format.html { redirect_to @note, notice: 'Sample was successfully created.'  }
  #   format.json { render :show, status: :created, location: @note }
  # else
  #   format.html { render :new }
  #   format.json { render json: @note.errors, status: :unprocessable_entity }
  # end
  redirect_to @note

end