This file contains 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
// Write some code, that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]. | |
function flatten(a) | |
{ | |
var b = []; | |
if (a.constructor === Array) | |
{ | |
for (var i = 0; i < a.length; i++) | |
{ | |
var c = flatten(a[i]); |
This file contains 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
module ClientsFormsHelper | |
# works with setupClientFormLink() in application-js.js | |
def link_to_clients_form_options(rec_type, rec_id, able_type, able_id, options) | |
name = '' | |
route = '' | |
funct = '' | |
popup = '' | |
css_class = '' | |
form_class = case rec_type |
This file contains 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
= puts "======== #{contact.class.name} #{contact.inspect}" | |
- if contact.class.name == 'Symbol' | |
= builder.fields_for contact do |f| | |
else | |
= builder.fields_for :clients_contacts, contact do |f| | |
= hidden_field_tag 'mode', (f.object.id.nil? ? 'new' : 'edit') |
This file contains 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
<form accept-charset="UTF-8" action="/tasks_assigned/update" data-remote="true" | |
id="task_assigned_25" method="post"> | |
<div style="margin:0;padding:0;display:inline"> | |
<input name="utf8" type="hidden" value="✓" /> | |
<input name="authenticity_token" type="hidden" | |
value="aAQ+tic2/L7pBgblP5rjJDGmoNlCQL5owOWQFOvec78=" /> | |
</div> | |
<input id="task_assigned_id" name="task_assigned[id]" type="hidden" value="25" /> | |
<input name="task_assigned[provider_completed]" type="hidden" value="0" /> | |
<input id="task_assigned_provider_completed" name="task_assigned[provider_completed]" |
This file contains 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
@task_assigned = TasksAssigned.find(25) | |
@task_assigned.provider_complete_dt = Time.now() | |
@task_assigned.save() |