Skip to content

Instantly share code, notes, and snippets.

@brobertsaz
Last active December 17, 2015 13:10
Show Gist options
  • Save brobertsaz/5615368 to your computer and use it in GitHub Desktop.
Save brobertsaz/5615368 to your computer and use it in GitHub Desktop.
changing table rows with jquery
.activity-log-header
%p.low
Refine results by Organization
%p
= select_tag 'search[query]', options_for_select(@organizations), class: 'chosen-select', prompt: "Search for organization to select", id: 'org-selection'
.activity_log_results
%table.fancy-table
%thead
%tr
%th Date
%th Time
%th Organization Name
%th Event
- @stream_events.desc(:time).each do |event|
%tbody
%tr{class: 'filtered-row'}
%td
= event.time.strftime("%Y-%m-%e")
%td
= event.time.strftime("%H:%M:%S")
%td{class: "#{event.organization.name_city_state}"}
- if event.organization
= event.organization.name_city_state
%td
= event.description
:javascript
$("#org-selection").click(function() {
$('.filtered-row').hide();
$(this.value).show();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment