Giter VIP home page Giter VIP logo

old-blog's Introduction

🏡 hugochougt.com

My home on the web.

old-blog's People

Contributors

imathis avatar hugochougt avatar fhemberger avatar parkr avatar pilif avatar gisikw avatar rslifka avatar zlu avatar omo avatar bendoerr avatar treyhunner avatar tomhoover avatar rwdaigle avatar mikl avatar lukearmstrong avatar vyper avatar sjml avatar axiac avatar tgray avatar samwhited avatar pw avatar pfista avatar elbowdonkey avatar jakemcc avatar jbrains avatar floydpink avatar iqandreas avatar sp3c73r2038 avatar scottwater avatar rtgibbons avatar

Watchers

 avatar

old-blog's Issues

Create a controller for polymorphic association

本质就是要找到对应的 polymorphic type 和 id。

经过搜索有三种主要方法:

Use carrierwave to upload images in Grape

def tempfile_to_uploaded_file(tempfile)
  if tempfile && tempfile.is_a?(Hash) && tempfile[:tempfile]
    ActionDispatch::Http::UploadedFile.new tempfile
  else
    tempfile
  end
end

在 Rails 中集成 SOAP Web Service

Gems:

# https://github.com/savonrb/savon
# Heavy metal SOAP client
gem 'savon', '~> 2.10.0'

# Rails 3/4 SOAP server library
# https://github.com/inossidabile/wash_out
gem 'wash_out', '~> 0.9.2'

测试代码示例

c = Savon.client do
  wsdl "http://xxx.com/llll/wsdl"
  wsse_auth 'aaa', 'ddd'
end

r = c.call :update_song, message: { id: '1115', reason: '啊啊~~~五~~~环~~' }
r.body

ActiveRecord date time range query

start_date = "2015-01-01".to_date
end_date   = "2015-01-02".to_date
Model.where(created_at: start_date..end_date)

这段代码有什么问题?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.