This file contains hidden or 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
# SQLite version 3.x | |
# gem install sqlite3-ruby (not necessary on OS X Leopard) | |
#development: | |
# adapter: sqlite3 | |
# database: db/development.sqlite3 | |
# pool: 5 | |
# timeout: 5000 | |
development: | |
adapter: postgresql |
This file contains hidden or 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 'spec_helper' | |
# This spec was generated by rspec-rails when you ran the scaffold generator. | |
# It demonstrates how one might use RSpec to specify the controller code that | |
# was generated by the Rails when you ran the scaffold generator. | |
describe ObjetosController do | |
login_usuario | |
it "deveria listar os objetos no index" do | |
objetos_mock = [mock_model(Objeto), mock_model(Objeto)] | |
Objeto.should_receive(:all).and_return(objetos_mock) |
This file contains hidden or 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 ControllerMacros | |
require 'spec_helper' | |
require 'factories' | |
def login_usuario | |
before(:each) do | |
@request.env["devise.mapping"] = Devise.mappings[:usuario] | |
@usuario = Factory.create(:usuario) | |
# @usuario.confirm! | |
sign_in @usuario |
This file contains hidden or 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 'spec_helper' | |
describe "Objetos" do | |
describe "GET /objetos" do | |
it "works! (now write some real specs)" do | |
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers | |
get objetos_path | |
response.status.should be(200) | |
end |
This file contains hidden or 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
Objetos | |
GET /objetos | |
works! (now write some real specs) (FAILED - 1) | |
Objeto | |
testando fabrica | |
deveria ser novo | |
ObjetosController | |
deveria listar os objetos no index |
This file contains hidden or 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
SELECT imoveis.id, imoveis.latitude, imoveis.longitude, | |
imoveis.area_privativa, imoveis.area_terreno, | |
imovel_naturezas.descricao AS imovel_natureza, | |
tipo_operacoes.descricao AS tipo_operacao | |
FROM imoveis | |
JOIN imovel_naturezas ON imovel_naturezas.id = imoveis.imovel_natureza_id | |
JOIN tipo_operacoes ON tipo_operacoes.id = imoveis.tipo_operacao_id | |
WHERE | |
ACOS( COS( RADIANS( latitude ) ) * | |
COS( RADIANS( $lat )) * |
This file contains hidden or 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
$( "#datepicker" ).datepicker( "option", "dateFormat", "dd/mm/yy" ); |
This file contains hidden or 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 partial | |
@res = Pergunta.find(params['id']) | |
# raise @res.resposta.inspect | |
respond_to do |format| | |
format.js{ render :index do |page| | |
page.replace_html 'result', :partial => 'partial' | |
end} | |
end |
This file contains hidden or 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
<% @categoria.each do |c| %> | |
<h3><%= c.nome %></h3> | |
<OL TYPE="a"> | |
<% c.perguntas.each do |p|%> | |
<li> | |
<span><%= link_to p.descricao, :controller => 'home', :action => 'partial', :id => p.id, :remote => true %></span> <span id="result"></span> | |
</li> | |
<% end %> | |
</OL> | |
<% end %> |
This file contains hidden or 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
<a href="url" class="botao_voltar" >oi</a> | |
<script type="text/javascript"> | |
$('.botao_voltar').button({ | |
icons: { primary: 'ui-icon-cancel'}, | |
text: true | |
}); | |
</script> |
OlderNewer