This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // THIS WORKS ON CHANGE | |
| $("select.show-tick").on('change', function(){ | |
| if($(this).val()=== "82"){ | |
| $(this).closest('td').find('.number-of-students').show(); | |
| } | |
| else { | |
| $(this).closest('td').find('.number-of-students').hide(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ON CHANGE SHOW/HIDE | |
| $("select.show-tick").on('change', function(){ | |
| if($(this).val()== 84){ | |
| $(this).parent('td').find('.number-of-students').show(); | |
| } | |
| else if($(this).val()== 85){ | |
| $(this).parent('td').find('.number-of-students').show(); | |
| } | |
| else { | |
| $(this).parent('td').find('.number-of-students').hide(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| post '/tasks/toggle_complete' => 'tasks#toggle_complete' | |
| resources :tasks | |
| tasks_toggle_complete POST /tasks/toggle_complete(.:format) tasks#toggle_complete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #TRYING TO PASS PARAMS TO THIS PATH BY DOING tasks_individual_view_path(my_param: x) | |
| <%= simple_form_for(tasks_individual_view_path, method: 'get', html: { class: 'form-horizontal'}) do %> | |
| <%= select_tag 'school_ids', options_for_select(@schools_id, params[:schools_id]), label: 'Projects', input_html: {class: 'multiselect', style: 'margin:0px 0px 5px 0px;', multiple: true} %> | |
| <%= submit_tag 'Submit', :class => 'btn btn-primary', style: 'margin:5px 0px 5px 0px;' %> | |
| <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # THIS IS WHAT I WANT BUT IT DOES NOT SHOW THE CURRENT VALUE IN THE SELECT | |
| <%= f.input :task_id, collection: Project.where(id:[1, 2]), as: :grouped_select, group_method: :tasks, label: 'Task', input_html: {class: 'selectpicker show-tick form-horizontal'} %> | |
| #THIS WILL SHOW THE CURRENT VALUE IN THE SELECT BUT DOES NOT DISPLAY THE SPECIFIC TASKS I WANT IN THE DISPLAY | |
| <%= f.input :task_id, collection: Task.all, label: 'Task', input_html: {class: 'selectpicker show-tick form-horizontal'} %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function calculateSum() { | |
| var sum = 0; | |
| $(".sum-hours").each(function() { | |
| sum += parseFloat(this.value); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(".sum-hours").each(function() { | |
| $(this).keyup(function(){ | |
| alert('pressed'); | |
| calculateSum(); | |
| }); | |
| }); | |
| function calculateSum() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%= simple_form_for(daily_time_cards_list_view_path, :method =>'get') do |f| %> | |
| <%= f.input :pay_period, as: :date_picker, label: 'Pay Period Start', required: false %> | |
| <%= submit_tag 'Submit', :class => 'btn btn-primary', style: 'margin:5px 0px 5px 0px;' %> | |
| <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"utf8"=>"✓", "/daily_time_cards/list_view"=>{"pay_period"=>"2014-07-03"}, "commit"=>"Submit", "controller"=>"daily_time_cards", "action"=>"list_view"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.ajax({ | |
| type: "GET", | |
| url: "/surveys/particular_users", | |
| dataType: "JSON", | |
| //Pass in each variable as a parameter. | |
| data: { | |
| particular_schools: ps, | |
| particular_employees: pe | |
| } |