Skip to content

Instantly share code, notes, and snippets.

@Haguilar91
Created December 11, 2019 22:06
Show Gist options
  • Save Haguilar91/e524054ea639cc08647913433b1b5ce6 to your computer and use it in GitHub Desktop.
Save Haguilar91/e524054ea639cc08647913433b1b5ce6 to your computer and use it in GitHub Desktop.
<% if current_doctor %>
<!--Ficha va aqui-->
<%conversation = current_member.mailbox.conversations.find(params[:id])%>
<div class="jumbotron">
<h1>Informacion de Paciente</h1>
<p>Edad: <%=@user.age%></p>
<p>Resumen del paciente: </p>
<p><%=@user.username%></p>
<p> Ingresar notas: </p>
<%=conversation.id%>
</div>
<%= form_for @note, remote: true do |f| %>
<%= f.hidden_field(:doctor_id, :value => current_doctor.id)%>
<%= f.hidden_field(:user_id, :value => @user.id)%>
<%= f.rich_text_area :body %>
<%= f.submit "Guardar Nota" %>
<% end %>
<!--Ficha termina aqui-->
<%end%>
def create
@note = Note.new(note_params)
@note.save
respond_to do |format|
format.html { redirect :back }
format.js
end
debug @note
end
# PATCH/PUT /notes/1
# PATCH/PUT /notes/1.json
def update
@note.update(note_params)
respond_to do |format|
format.html { redirect :back }
format.js
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment