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
| #!/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 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
| 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 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
| <script type="text/javascript"> | |
| jQuery(document).ready(function() { | |
| jQuery('#regform_district_id').html("<option value=''>Select District</option>"); | |
| }); | |
| </script> |
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 "dynamic_districts/:id" => "regforms#dynamic_districts" |
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
| $('#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 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
| 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 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
| belongs_to :state | |
| belongs_to :district |
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
| def dynamic_districts | |
| @districts = District.find_all_by_state_id(params[:id]) | |
| respond_to do |format| | |
| format.js | |
| end | |
| end |
NewerOlder