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
def dynamic_districts | |
@districts = District.find_all_by_state_id(params[:id]) | |
respond_to do |format| | |
format.js | |
end | |
end |
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
belongs_to :state | |
belongs_to :district |
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
jQuery(document).ready(function() { | |
jQuery('#regform_state_id').change(function() { | |
var data=$('#regform_state_id').val(); | |
$.ajax({ | |
type: "POST", | |
url: "http://"+location.host+"dynamic_districts/"+data, | |
data: data, | |
}); | |
}); | |
}); |
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
$('#regform_district_id').empty(); | |
<% for district in @districts %> | |
$('#regform_district_id').append($("<option></option>").attr("value",<%= district.id %>).text('<%= district.name %>')); | |
<% end %> |
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
post "dynamic_districts/:id" => "regforms#dynamic_districts" |
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
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
jQuery('#regform_district_id').html("<option value=''>Select District</option>"); | |
}); | |
</script> |
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
gem install mysql2 -- '--with-mysql-lib="c:\Program Files (x86)\MySQL\MySQL Server 5.6\lib" --with-mysql-include="c:\Program Files (x86)\MySQL\MySQL Server 5.6\include"' | |
# for specific version | |
gem install mysql2 -v=0.3.14 -- '--with-mysql-lib="c:\Program Files (x86)\MySQL\MySQL Server 5.6\lib" --with-mysql-include="c:\Program Files (x86)\MySQL\MySQL Server 5.6\include"' |
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
#!/bin/bash | |
# Warn before pushing to protected branches | |
# Make script executable with chmod +x pre-push | |
# Bypass with git push --no-verify | |
BRANCH=`git rev-parse --abbrev-ref HEAD` | |
PROTECTED_BRANCHES="^(master|dev|release-*|patch-*)" | |
if [[ "$BRANCH" =~ $PROTECTED_BRANCHES ]]; then | |
read -p "Are you sure you want to push to \"$BRANCH\" ? (y/n): " -n 1 -r < /dev/tty |
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
after "deploy:symlink", "deploy:restart_workers" | |
## | |
# Rake helper task. | |
# http://pastie.org/255489 | |
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/ | |
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/ | |
def run_remote_rake(rake_cmd) | |
rake_args = ENV['RAKE_ARGS'].to_s.split(',') | |
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}" |
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
#-- encoding: UTF-8 | |
module StripeNewCheckoutPlugin | |
def self.included(base) | |
base.class_eval do | |
# | |
end | |
end | |
# credit card commons fields |
OlderNewer