Created
July 30, 2012 18:17
-
-
Save amite/3208857 to your computer and use it in GitHub Desktop.
Get request for laravel with backbone not working
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
var InvoiceMaker = { | |
Models : {}, | |
Controllers: {}, | |
Views: {} | |
} | |
InvoiceMaker.Models.Client = Backbone.Model.extend({ | |
defaults : { | |
name: "Client Name", | |
notes: "Enter notes here" | |
}, | |
url: "laravelbackbone/public/clients" | |
}) | |
var client = new InvoiceMaker.Models.Client; | |
client.fetch(); |
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 Clients_Controller extends Base_Controller { | |
public $restful = true; | |
public function get_index() | |
{ | |
return Response::eloquent(Client::find(1)); | |
} | |
} |
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
Route::controller('clients'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment