Guest User

Untitled

a guest
Jan 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. def create
  2. has_active_authorization = PatientAuthorization.find(params[:visit][:patient_authorization_id])
  3. if has_active_authorization.active
  4. @visit = Visit.new(params[:visit])
  5. end
  6. respond_to do |format|
  7. if @visit.save
  8. format.html { redirect_to(@visit, :notice => 'Visit was successfully created.') }
  9. format.xml { render :xml => @visit, :status => :created, :location => @visit }
  10. else
  11. format.html { render :action => "new" }
  12. format.xml { render :xml => @visit.errors, :status => :unprocessable_entity }
  13. end
  14. end
  15. end
Add Comment
Please, Sign In to add comment