Skip to content

Instantly share code, notes, and snippets.


Chris Lerum chrislerum

View GitHub Profile
View approval_buttons.html.haml
= form_for(@profile) do |f|
= f.hidden_field @hidden_field_name, :value => @hidden_field_value
= f.submit @button_message, class: "btn btn-success btn-sm pull-left btn-group-item", data: { confirm: @button_confirmation }
View GetAccounts.request.xml
<soap:Envelope xmlns="" xmlns:xsi="" xmlns:xsd="" xmlns:soap="" >
View api_test.rb
require 'rubygems'
gem 'savon', '=1.1.0'
require 'savon'
HMAC = 'string'
'Credentials' => {
'HMac' => HMAC,

Asking questions, the right way

When asking questions in the #rubyonrails channel, please follow these 12 simple rules. Can't count that high? The first 7 will get you in most people's good books.

  1. Do your research beforehand. Your question may be answerable with a quick Google search or by simply experimenting. If you're using a method in Rails, look it up in the API Docs or in the Official Guides.
  2. If you've tried Googling, explain what terms you've tried to use so people can better help you.
  3. Clearly explain what is happening and create a Gist ( or Pastie ( of the code that is causing the problem you are encountering, as well as any useful output like stacktraces. A "Full Trace" as opposed to the default "Application Trace" is preferred. NO FAKE CODE. If you're under an NDA, we cannot help you with your problem. Go hire a consultant.
  4. **Do not use any service that is not Pastie or Gist
View claim_builder.rb
:adapter => "mysql",
:user => "root",
:password => "",
:database => "arvest"
class Employee < ActiveRecord::Base
View activescaffold-paperclip.rb
class User < ActiveRecord::Base
has_attached_file :avatar, :styles => {:thumb => '100x100>'}
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :avatar_file_name