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 doGet() { | |
| return ContentService.createTextOutput("success"); | |
| } | |
| function doPost(e) { | |
| var webhookData = JSON.parse(e.postData.contents).events[0]; | |
| var message,replyToken; | |
| //送られてきた文言が変数messageに入る。(ボタンを押した時のテキスト) | |
| message = webhookData.message.text; | |
| replyToken = webhookData.replyToken; |
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
| /* パソコンで見たとき*/ | |
| .pc-header { display: block !important; } | |
| .sma-header { display: none !important; } | |
| /* スマートフォンで見たとき*/ | |
| @media only screen and (max-width: 750px) { | |
| .pc-header { display: none !important; } | |
| .sma-header { display: block !important; } | |
| } |
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
| //現在のheight取得 | |
| curHeight = $(this).height(); | |
| //autoにした場合のheightを取得 | |
| autoHeight = $(this).css('height', 'auto').height(); | |
| //autoにした場合のheightへ向かってanimate | |
| //数値なのでanimateが有効 | |
| $(this).height(curHeight).animate({height: autoHeight}, 150); |
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
| .card.my-2.mx-0.border-0 | |
| .text-muted.small.p-2 | |
| 名前: #{comment.name} | |
| -# up,downの比率を取得 | |
| - up_down_rate = ((comment.up.to_f) / (comment.up.to_f + comment.down.to_f)) * 100 | |
| -# 比率によりクラスを分ける | |
| - if 90 <= up_down_rate | |
| .p-2.comment.comment-level-5 | |
| #{comment.comment} | |
| - elsif 70 <= up_down_rate && up_down_rate < 90 |
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
| # この2行を削除 | |
| # Use sqlite3 as the database for Active Record | |
| gem 'sqlite3' | |
| group :development, :test do | |
| # Call 'byebug' anywhere in the code to stop execution and get a debugger console | |
| gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] | |
| #ここ1行追加 | |
| gem 'sqlite3', '1.3.13' | |
| 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
| // 部分テンプレート内での変数名は note が勝手に指定されます。 | |
| // 変数noteにそれぞれの@noteが都度入ってくる感じです。 | |
| = link_to note_path(note) do | |
| .notes__body__box | |
| .notes__body__box__title | |
| = note.title | |
| %hr.notes__body__box__line/ | |
| .notes__body__box__body |
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
| $('.message_form').on('submit', function(e) { | |
| e.preventDefault(); | |
| var group_id = $('.group_id').val(); | |
| var fd = new FormData($('.message_form').get(0)) | |
| fd.append('body', $('.form').val()) | |
| // $('.form').val() => "aaa" | |
| console.log(fd); | |
| // ここではfdを見ると FormData = {} となり、一見何も入っていないように見える | |
| $.ajax({ |
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
| '<input 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
| var inputs = input.split(" ").filter(function(e) { return e; }); |
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 'rspec-rails' | |
| gem 'factory_girl_rails' | |
| gem 'faker' |
NewerOlder