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 SitesController < ApplicationController | |
before_filter :authenticate_user, :except => "show" | |
def new | |
@site = Site.new | |
@site.domain = Domain.new | |
end | |
def activate | |
@site = Site.find(params[:id]) | |
flash[:message] = render_to_string :partial=>"sites/welcome_message" | |
redirect_to sites_path |
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 Site < ActiveRecord::Base | |
after_create :create_heroku_domain,:create_bucket,:create_dropbox_folder | |
belongs_to :user | |
has_one :domain | |
has_one :bucket | |
has_many :pages | |
accepts_nested_attributes_for :domain, :allow_destroy => true | |
validates_uniqueness_of :path, :scope => :user_id | |
def self.find_by_domain(domain) |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, blue); | |
min-height:100%; | |
duration(2s) |
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
{ | |
"message": { | |
"text": "OK", | |
"code": 0, | |
"version": "1.1.1" | |
}, | |
"items": [{ | |
"nm": "Angelo's Pizza", | |
"img": "", | |
"rating": 4.5, |
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
curl "localhost:3000/api/discs.json?auth_token=U4gdadgu2jFpdfG5Bhue" | |
[{ | |
"disc": { | |
"id": 485, | |
"tracks": [{ | |
"id": 276, | |
"title": "implement 24/365 initiatives" | |
}], | |
"album": { |
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
Note (only one track in the development database) | |
curl "localhost:3000/api/discs/485/tracks?auth_token=U4gdadgu2jFpdfG5Bhue" | |
[{"track":{"id":276,"title":"implement 24/365 initiatives"}}]% |
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
$ curl "localhost:3000/api/discs/last_update.json?auth_token=U4gdadgu2jFpdfG5Bhue" | |
"2012-03-26T15:09:18Z"% |
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
curl -X POST -d"password=****&email=mason@murfie.com" localhost:3000/api/tokens | |
{"token":"we7q8NwHWJ42QysB5y8q"}% |
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
$ curl "https://murfie2-staging.herokuapp.com/api/discs.json?auth_token=XXX" | |
$ curl "https://murfie2-staging.herokuapp.com/api/discs/1631/tracks/95945.json?auth_token=XXX" | |
=> {"track":{"id":95945,"url":"https://murfie-streaming-test.s3.amazonaws.com/2/1.mp3?key=XXX"}} |
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
$ curl "http://localhost:3000/api/discs/1636.json?auth_token=xxx" | |
{ | |
"disc": { | |
"album_id": 1515, | |
"amazon_id": null, | |
"amazon_purchase": false, | |
"comment": null, | |
"created_at": "2012-04-04T20:47:22Z", | |
"id": 1636, |