Learn To Code Workshop
  • Introduction
  • Setup
    • Mac OSX
    • Linux
  • User stories
  • Working with BDD
  • Setting up
  • Focus on the feature
  • Adding views
  • Complex views
  • Adding a database
  • Adding a Course
  • Adding a User
  • Authenticating a User
  • Logging in
  • Logging out
  • Restricting access
  • Adding relationships
  • The look and feel
  • Adding Students
  • Rendering certificates
  • The certificate layout
  • Generating images of certificates
  • The verification interface
  • Storage in the cloud
  • Refactoring the workflow
  • Refactoring the verification view
  • Deployment
  • Verification stats
  • Distributing the certificates
  • Moving forward
Powered by GitBook
On this page

Refactoring the verification view

Just a quick modification of the template that is called when we verify a course certificate.

Now that we have access to the image as a AWS resource, we can modify the view and display the certificate and the image:

# lib/views/verify/valid.erb

<h3 style="color: #368a55">Valid course certificate for</h3>
<h2><%= link_to @certificate.student.full_name, @certificate.certificate_url %></h2>
<p><%= link_to @certificate.delivery.course.title, "/courses/delivery/show/#{@certificate.delivery.id}" %></p>
<p>Course date: <%= @certificate.delivery.start_date %></p>

<img src="<%= @certificate.image_url %>" />
PreviousRefactoring the workflowNextDeployment

Last updated 6 years ago