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
Controller: | |
def index | |
@site = Site.new | |
@todos_sites = Site.all | |
end | |
View: | |
<% @todos_sites.each do |site| %> | |
Test Line | |
<% end %> |
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
C:\Projetos\steste>rake spec | |
(in C:/Projetos/steste) | |
C:/Ruby192/bin/ruby.exe -S bundle exec rspec "./spec/helpers/home_helper_spec.rb | |
" | |
F | |
Failures: | |
1) HomeHelper check ret_true helper | |
Failure/Error: helper.ret_true.should be_false | |
expected true to be 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
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
before_filter do | |
# Find Account_ID by seach for a domain - NOT Refactored yet | |
host_id = $memcache_instance.get('hosts/' + request.host) | |
unless host_id | |
host_db_row = BimbooHost.where( :host => request.host ).one | |
if host_db_row | |
$memcache_instance.set('hosts/' + request.host, host_db_row.bimboo_account_id, 60*60) |
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
def set_account_id | |
return false if BimbooAccount.current.nil? | |
self.bimboo_account_id = BimbooAccount.current._id | |
end |
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
module ApplicationHelper | |
def configurar_pedido(pedido) | |
returning(pedido) do |p| | |
p.iteracoes.build if p.iteracoes.empty? | |
end | |
end | |
end |
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
Adicionar um metodo no dashboard (config.php), e criar uma rota. | |
O metodo vai conter | |
function getting_started( $params ) | |
{ | |
print file_get_contents("http://www.bimboo.com.br/..."); | |
return true; | |
} | |
// adicionar a rota, ex /admin/bimboo_getting_started |
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 mobile_detector_controller | |
{ | |
function classico($params) { | |
global $build_page_cache,$expiration_date; // Acessar globais de geração de Cache | |
// Desabilitar cache para url | |
$build_page_cache = false; $expiration_date = 0; | |
// Setar Cookie 'ignorarMobile' com valor 1 | |
web::cookie_set_variable('ignorarMobile',1,time()+(60*60*24*365)); |
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
<script type="text/javascript"> | |
window.addEvent('domready', function() { | |
if (Cookie.read('ignoreMobile') != 1) { | |
if( navigator.userAgent.match(/Android/i) || | |
navigator.userAgent.match(/webOS/i) || | |
navigator.userAgent.match(/iPhone/i) || | |
navigator.userAgent.match(/iPod/i) | |
){ |
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
it "should be readonly after find if locked equals true" do | |
@log = Fabricate(:invoice_log_locked) | |
lambda { | |
@locked_log = InvoiceLog.where(:locked => true).first() | |
@locked_log->description = "Changing the Description" | |
@locked_log->save() | |
}.should raise_error(ActiveRecord::ReadOnlyRecord) | |
end |
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
Fs = require 'fs' | |
Path = require 'path' | |
Flow = require 'async' | |
class TestingSomething | |
organize_basket: ( next_callback ) -> | |
@basket = {} | |
next_callback null |
OlderNewer