Created
November 13, 2012 17:34
-
-
Save clouddueling/4067189 to your computer and use it in GitHub Desktop.
Using Eloquent with Javascript
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
function get_card($card_id) | |
{ | |
$card = Card::find($card_id); | |
$data = array( | |
'json_card' => json_encode($card), | |
); | |
$this->layout->nest( 'content', 'card.form_editor', $data ); | |
} |
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
<script> | |
$(function() { | |
var card = {{ $json_card }}.attributes | |
l(card.id) | |
l(card) | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment