Skip to content

RailsGirlsRome/certifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

               ***     ***
             **   ** **   **
            *       *       *
            *               *
             *             *
              **         **
                **     **
                  ** **
                    *
 ____       _ _        ____ _      _
|  _ \ __ _(_) |___   / ___(_)_ __| |___
| |_) / _` | | / __| | |  _| | '__| / __|
|  _ < (_| | | \__ \ | |_| | | |  | \__ \
|_| \_\__,_|_|_|___/  \____|_|_|  |_|___/

Welcome to the Certifier Rails Girls app!

Work in progress below…

Add application gems

* pdfkit
* wkhtmltopdf-binary
* bootstrap-sass
* sqlite3 (only development)
* pg (only production)

Build html example template for the certificate

* see public/example.html

Add twitter bootstrap assets

* import twitter bootstrap css files
* require twitter bootstrap javascripts
* change application layout to use twitter bootstrap html structure

Add Welcome page (step 1)

* generate welcome controller with index action: `rails g controller welcome index`
* use welcome#index as homepage
* update homepage text contents

Add Certificate pages (step 2)

* generate certificate scaffold: `rails g scaffold certificate name email`
* remove unused certificate resource routes, actions, views
* add certificate model validations
* update certificate controller and views code

Add PDF representation of Certificate (step 3)

* add erb version of the example.html template
* add controller code to handle pdf representation of certificate

“‘ruby

# ...
format.pdf do
  kit = PDFKit.new(certificate_html)
  filename = "#{@certificate.name.parameterize}.pdf"
  send_data kit.to_pdf, :filename => filename, :content_type => 'application/pdf'
end

def certificate_html
  template = ERB.new File.read(Rails.root.join('app/views/certificates/example.html.erb'))
  template.result(binding)
end

“‘

Improve Styles

* remove autogenerate scaffold.css file
* add some css styles

About

❤ The Rails Girls Rome Certificate Builder ❤

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published