Skip to content

Instantly share code, notes, and snippets.

Rails Admin field configuration

rails_admin do
  list do
    field :customfield do
      def value
        bindings[:object].your_method
      end
    end
 end

In your logged_in_controller.rb

class LoggedInController < ApplicationController
  before_filter :authenticate_user!
end

In your logged_in_controller_spec.rb

Heroku Mailer (SendGrid) configuration steps

  • Go to your heroku application.

  • Add SendGrid addons

  • Config STMP settings to your config/environment.rb

ActionMailer::Base.smtp_settings = {
@ivan22
ivan22 / Gemfile
Created June 5, 2014 03:58 — forked from cblunt/Gemfile
Carrierwave S3 Amazon
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL

These are steps to setup a new project in ROR.
You must configure and install your Gems individually instead of copying the Gemfile from a previous project.

Refer to Heroku setup if you want to push your project to Heroku.

Setup directory

# Create directory in ~/workspace
mkdir ./testproject
cd ./testproject
@ivan22
ivan22 / 0_reuse_code.js
Created July 18, 2014 10:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console