get gemset list
rvm gemset list
empty gemset
rvm getmset empty [gemset_name]
get gemset list
rvm gemset list
empty gemset
rvm getmset empty [gemset_name]
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 = {
User.where(:role => :admin).order(:username).pluck(:email) #=> [admin1@example.com, admin2@example.com]
In your logged_in_controller.rb
class LoggedInController < ApplicationController
before_filter :authenticate_user!
end
In your logged_in_controller_spec.rb
Rails Admin field configuration
rails_admin do
list do
field :customfield do
def value
bindings[:object].your_method
end
end
end
class UrlValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
record.errors[attribute] << (options[:message] || "must be a valid URL") unless url_valid?(value)
end
# a URL may be technically well-formed but may
# not actually be valid, so this checks for both.
def url_valid?(url)
url = URI.parse(url) rescue false
##Capybara - Wait for ajax to complete
def wait_for_ajax
Timeout.timeout(Capybara.default_wait_time) do
loop do
active = page.evaluate_script('jQuery.active')
break if active == 0
end
end
The markup
<div id="parent">
<a id="child">Click here please</a>
</div>
Instead of binding event this way this way