Skip to content

Instantly share code, notes, and snippets.

View captproton's full-sized avatar

captproton captproton

View GitHub Profile
<h1>Editing profile</h1>
<% form_for(@profile, :url => user_profile_path(@user) ) do |form| %>
<%= form.error_messages %>
<%= render :partial => 'form' %>
<p>
<%= f.submit 'Update' %>&nbsp;&nbsp;<%= link_to "Cancel", root_path, :class => "cancel" %>
</p>
<% end %>
<% form_for :person_review,
:url => move_person_reviews_path,
:html => {:method => :put } do |f| -%>
<%= f.submit "Complete Import" %>
<table>
<tr>
<th>Case no</th>
<th>name</th>
shoulda test:
test "should destroy shop" do
assert_difference('Shop.count', -1) do
delete :destroy, :id => shops(:one).to_param
end
assert_redirected_to shops_path
end
require 'test_helper'
class ShopsControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:shops)
end
test "should get new" do
require 'rubygems'
require 'httpclient'
require 'pp'
def get_page_source(page_id)
clnt = HTTPClient.new
body = { 'memberDirectoryPageId' => page_id }
uri = "http://www.peninsulashops.com/Content/Members/MemberDirectoryWebService.asmx/LoadMembers"
return clnt.post(uri, body).content
end
require 'httpclient'
require 'pp'
class Shop < ActiveRecord::Base
## validates_presence_of :lat, :lng
acts_as_mappable :auto_geocode => true
validates_presence_of :lat, :lng
before_validation_on_create :geocode_address
class Shop < ActiveRecord::Base
## validates_presence_of :lat, :lng
acts_as_mappable :auto_geocode => true
validates_presence_of :lat, :lng
before_validation_on_create :geocode_address
def full_address
[address, city].join(' ')
end
$ heroku rake app:parse --trace
rake aborted!
Don't know how to build task 'app:parse'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1728:in `[]'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2050:in `invoke_task'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
config/database.yml
coverage/*
db/*.sql*
log/*.log
tmp/**/*
public/avatars/**/*
public/javascripts/cache/*.js
public/stylesheets/cache/*.css
nbproject
.DS_Store
@captproton
captproton / gist:348195
Created March 29, 2010 18:09
RestfulX account error
## Flash Player error
Error: An error has occured while invoking service provider with id: 1 :[FaultEvent fault=[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost:3000/opportunities/52.fxml?_session_id=5ec554401de561a10f8b68a0bced4110"]. URL: http://localhost:3000/opportunities/52.fxml?_session_id=5ec554401de561a10f8b68a0bced4110"] messageId="A566ED0B-62A5-4ABC-1C71-AB1B2CD5F32A" type="fault" bubbles=false cancelable=true eventPhase=2]
at org.restfulx.services::ServiceResponder/invokeOnFailure()[/Users/Dima/Projects/dev/restfulx_framework/framework/src/org/restfulx/services/ServiceResponder.as:146]
at org.restfulx.services::ServiceResponder/fault()[/Users/Dima/Projects/dev/restfulx_framework/framework/src/org/restfulx/services/ServiceResponder.as:127]
at <anonymous>()[/Users/Dima/Projects/dev/restfulx_framework/framework/src/org/restf