Skip to content

Instantly share code, notes, and snippets.

@kakawka
Created December 7, 2014 11:38
Show Gist options
  • Save kakawka/605a519321917ee41b42 to your computer and use it in GitHub Desktop.
Save kakawka/605a519321917ee41b42 to your computer and use it in GitHub Desktop.
- @license_agreements_term.each do |lat|
- @term_acceptance = TermAcceptance.where(license_agreement_term_id: lat.id)
- unless params["from-#{lat.id}"].blank?
- @term_acceptance = @term_acceptance.where('DATE(created_at) >= ?', params["from-#{lat.id}"])
- unless params["to-#{lat.id}"].blank?
- @term_acceptance = @term_acceptance.where('DATE(created_at) <= ?', params["to-#{lat.id}"])
.well
.row
.col-md-7
h4 Text
= raw lat.text
h4 Code
= lat.code
br
br
.col-md-5
= form_tag("", method: :get, remote: true) do
.row
.col-md-4
= label_tag "From"
br
= date_field_tag("from-#{lat.id}", params["from-#{lat.id}"])
.col-md-4
= label_tag "to"
br
= date_field_tag("to-#{lat.id}", params["from-#{lat.id}"])
.row
.col-md-4
br
= hidden_field_tag :lat, lat.id
= hidden_field_tag :term_acceptance, @term_acceptance.group_by_day(:created_at).count.value
= submit_tag "Submit", class: "btn btn-default"
div id = "linechart-#{lat.id}"
= line_chart @term_acceptance.group_by_day(:created_at).count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment