Skip to content

Instantly share code, notes, and snippets.

View fhyfirman's full-sized avatar

Firman fhyfirman

  • HungryHub
View GitHub Profile
@marekciupak
marekciupak / validating_http_parameters.md
Last active July 27, 2024 02:20
Ruby on Rails: Validating HTTP parameters

Validating HTTP parameters

Let's say you need to handle the following action:

class UsersController < ApplicationController
  def update
    user = User.find(id)
    result = update_user(user, attrs)
    
@narath
narath / faraday_post.rb
Created May 8, 2017 17:24
How to do a x-www-form-urlencoded post with Faraday
require 'faraday'
require 'uri'
data = {
:your_data => "YOUR DATA"
}
url = "some url"
response = Faraday.post(url) do |req|