イギリスにて起業しました。 おそらく、日本人のイギリス法人の社長としては最年少であると思います。この会社は仮想通貨の取引所を運営することを目的するとともに、ICOプロジェクトの効率化を図って行くことを目的としています。興味のある方はnishidaryu416@gmail.comまで
投稿
translator
- リンクを取得
- ×
- メール
- 他のアプリ
Twitter like にgif画像取得 注意 gon(gem)必要ないかもだけど、普通のjsの変数だとエラーが出たので、、 unirest(gem)が必要です。さもなければ、ご自身の気に入っている方法でgetしてください。 実装 <input type="text" class="q"> <div id="giphy"></div> <%= link_to 'Gif画像を追加',get_giphy_path(q:""), remote: true ,class: 'btn',id:"get_giphy"%><br> <script> $("#get_giphy").click(function(){ gon.q=$(".q").val() $("#get_giphy").attr("href", "/words/get_giphy?q="+gon.q) }); </script> link_toを使ってAjax化 クリックされたら class="q" の内容を取得してurlを書き換えそしてAjax化してあるactionを呼ぶだけ $('#giphy').append "<%=j render 'giphy' %>" giphy使ってます def get_giphy gon.q @giphys=[] giphys=Unirest.get "https://api.giphy.com/v1/gifs/search?api_key=your_key&q=#{params[:q]}&limit=25&offset=0&rating=G&lang=en" ...
- リンクを取得
- ×
- メール
- 他のアプリ
I created a gem!! Introduction I created a Gem which helps you to check your users message whether contains a terrible word,or not. Usage require "message_judgment" => true irb(main):002:0> message="Hello,I want your sex!" => "Hello,I want your sex!" irb(main):003:0> targets=["sex","fack"] => ["sex", "fack"] irb(main):004:0> MessageJudgment.message_judgment?(message,targets) => "Hello,I want your !" First,you gotta give first argument your users message which you wanna chck、and then give second argument some terrible word or forbidden word as an array. That's all! You think this's really convenient,don't you? Let's use this one!! Here is repository