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
= simple_form_for [:admin, @holiday_schedule] do |f| | |
= render 'error_messages', target: @holiday_schedule, f: f if @holiday_schedule.errors.any? | |
= f.input :name | |
.control-group | |
= f.label :holidays | |
= f.simple_fields_for :holidays do |holiday| | |
= render 'holiday_fields', f: holiday | |
.nested-fields-link | |
= link_to_add_association t('actions.add', | |
:model => Holiday.model_name.human.titleize), f, :holidays |
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
var inputs = document.getElementsByTagName('input'); | |
for (var i=0; i < inputs.length; i++) { | |
if (inputs[i].getAttribute('type').toLowerCase() === 'password') { | |
inputs[i].setAttribute('onpaste', ''); | |
} | |
} |
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
class Registration < AggregateForm | |
component :user, :email, :password | |
component :profile, :zip | |
validate_components :promote_errors | |
validate # whatever else you want | |
end | |
# This would give you | |
# * email, password, zip attrs |
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
#!/usr/bin/env ruby | |
require "octokit" | |
if (ARGV.length < 1) | |
puts "You must supply a GitHub access token" | |
exit 1 | |
end | |
access_token = ARGV[0] |