Skip to content

Instantly share code, notes, and snippets.

def update
@device = Device.find(params[:id])
@device.latest_activity = Time.now
@device.save()
@device.update_attributes(params[:device])
respond_with(@device)
end
def update
@device = Device.find(params[:id])
@device.update_attributes(params[:device])
respond_with(@device)
end
class Etaxi.Routers.Base extends Backbone.Router
routes:
'register' : 'registerDevice'
'a' : 'b'
b: ->
alert "a"
initialize: ->
createDevice: (e) ->
event.preventDefault()
attributes =
licence_plate: $(@el).find('input[name="licence-plate"]').val()
contact_name: $(@el).find('input[name="contact-name"]').val()
contact_phone: $(@el).find('input[name="contact-phone"]').val()
@collection.create attributes,
wait: true
# Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# PostgreSQL
gem 'pg'
def index
if params[:near]
@locations = Location.near(
params[:near], # Latitude, Longitude
params[:radius] ? params[:radius].to_i : 10,
:units => :km
)
else
@locations = Location.all
end
2012-01-27T13:32:20+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `block in require'
2012-01-27T13:32:20+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency'
2012-01-27T13:32:20+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/builder.rb:51:in `instance_eval'
2012-01-27T13:32:20+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
2012-01-27T13:32:20+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/builder.rb:40:in `eval'
2012-01-27T13:32:20+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/builder.rb:40:in `parse_file'
2012-01-27T13:32:20+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/commands/server.rb:46:in `app'
2012-01-27T13:32:20+00:00 app[web.1
2012-01-26T21:36:18+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2012-01-26T21:36:18+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
2012-01-26T21:36:18+00:00 app[web.1]: from /app/config.ru:1:in `new'
2012-01-26T21:36:18+00:00 app[web.1]: from /app/config.ru:1:in `<main>'
2012-01-26T21:36:18+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/server.rb:200:in `app'
2012-01-26T21:36:18+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/commands/server.rb:46:in `app'
2012-01-26T21:36:18+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/builder.rb:40:in `eval'
2012-01-26T21:36:18+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/builder.rb:40:in `parse_file'
2012-01-26T21:36:18+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.0/lib/rack/server.rb:252:in `start'
20
def index
@locations = Location.all
respond_with @locations.as_json(
:except => [:id, :created_at],
:include => {
:bounds => {
:only => [:lat, :lng]
},
:media => {
[
{
"description":"Die Wiener Stadhalle",
"lat":null,
"lng":null,
"name":"Stadthalle",
"updated_at":"2012-01-24T11:28:19Z",
"bounds":[
{
"lat":13.133456,