Skip to content

Instantly share code, notes, and snippets.

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
# 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'
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
class Etaxi.Routers.Base extends Backbone.Router
routes:
'register' : 'registerDevice'
'a' : 'b'
b: ->
alert "a"
initialize: ->
def update
@device = Device.find(params[:id])
@device.update_attributes(params[:device])
respond_with(@device)
end
def update
@device = Device.find(params[:id])
@device.latest_activity = Time.now
@device.save()
@device.update_attributes(params[:device])
respond_with(@device)
end
# Error: <class:Video>': undefined method `hello' for Zencodera:Module (NoMethodError)
# lib/zencodera.rb
module Zencodera
def hello
puts "Hello..."
end
end
# models/video.rb
# Error: invalid API key
# lib/video_encoder.rb
module VideoEncoder
def self.encode(video = nil)
response = Zencoder::Job.create({:input => "test.mp4"})
puts response.inspect
end
Rails.application.routes.url_helpers.notification_api_v1_zencoder_job_url
ActionController::RoutingError: No route matches {:format=>"json", :action=>"notification", :controller=>"api/v1/zencoder_jobs"}
from /Users/drale2k/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:503:in `raise_routing_error'
from /Users/drale2k/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:499:in `rescue in generate'
from /Users/drale2k/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:491:in `generate'
from /Users/drale2k/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:532:in `generate'
from /Users/drale2k/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:557:in `url_for'
from /Users/drale2k/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:329:in `url_for'
from /Users/drale2k/.rvm/gems/ruby-1.9.3-p0/g
Rossauer Kaserne
Josephinum
Produktenbörse
Chemisches Institut
Postsparkasse
Schubladkastenhaus
Theresianum
Hotel Imperial (Palais Württemberg)
Schloss Belvedere
Kammerspiele