This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ContactMailer < ActionMailer::Base | |
default from: "no-reply@test.com" | |
def send_mailer(user_mailer) | |
@user_mailer = user_mailer | |
mail(to: "rafaelrpb@hotmail.com", | |
subject: "New Email", | |
body: "Test Its Works.." | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"auto_complete": true, | |
"auto_complete_commit_on_tab": true, | |
"auto_indent": true, | |
"bold_folder_labels": true, | |
"default_encoding": "UTF-8", | |
"default_line_ending": "system", | |
"detect_indentation": true, | |
"draw_white_space": "all", | |
"ensure_newline_at_eof_on_save": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ipcarrier::Application.configure do | |
config.cache_classes = true | |
config.eager_load = true | |
config.consider_all_requests_local = false | |
config.action_controller.perform_caching = true | |
config.serve_static_assets = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
servers: ["192.241.189.203"] | |
Password: | |
[192.241.189.203] executing command | |
command finished in 10620ms | |
* 2013-08-20 11:26:17 executing `deploy:finalize_update' | |
triggering before callbacks for `deploy:finalize_update' | |
* 2013-08-20 11:26:17 executing `deploy:assets:symlink' | |
* executing "rm -rf /var/www/ipcarrier/releases/20130820142600/public/assets && mkdir -p /var/www/ipcarrier/releases/20130820142600/public && mkdir -p /var/www/ipcarrier/shared/assets && ln -s /var/www/ipcarrier/shared/assets /var/www/ipcarrier/releases/20130820142600/public/assets" | |
servers: ["192.241.189.203"] | |
[192.241.189.203] executing command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#encoding: utf-8 | |
require 'spec_helper' | |
describe "login com facebook" do | |
before do | |
request.env["devise.mapping"] = Devise.mappings[:user] | |
request.env["omniauth.auth"] = OmniAuth.config.mock_auth[:facebook] | |
end | |
it "sets a session variable to the OmniAuth auth hash" do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsersController < ApplicationController | |
before_filter :set_user | |
def edit | |
end | |
def update | |
if @user.update_attributes(user_params) | |
redirect_to root_path, notice: t('devise.registrations.updated') | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
class ${1:model_pluralize}Controller < ApplicationController | |
before_action :set_${2:model_downcase}, only: [ :show, :edit, :update ] | |
def index | |
@${3:model_downcase_pluralize} = ${2:model_downcase}_base.page(params[:p]) | |
end | |
def new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
def add_xml(xml) | |
xml.send(:level, 'last') | |
end | |
builder = Nokogiri::XML::Builder.new do |xml| | |
xml.send(:level_1) do | |
xml.send(:level_2) do | |
add_xml(xml) if 1 == 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Env var | |
export DISPLAY=:0 | |
# Dependências | |
apt-get install xvfb chromedrive | |
# Configuração do Driver | |
options = { | |
desired_capabilities: { | |
chromeOptions: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/model/ad_image.rb | |
class AdImage < ApplicationRecord | |
belongs_to :ad | |
# Com o store: 'ad_images_store' estou usando meu backend que criei no initializer para store | |
# Com o cash: 'ad_images_cache' estou usando meu backend que criei no initializer para cache | |
attachment :image, store: 'ad_images_store', cache: 'ad_images_cache', type: :ad_images | |
end |
OlderNewer