Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):
class Shop extends Eloquent {}
Using custom table name
protected $table = 'my_shops';
| /** @jsx React.DOM */ | |
| var LopMonHoc = React.createClass({ | |
| getInitialState: function(){ | |
| return {data: []} | |
| }, | |
| loadData: function(){ | |
| $.ajax({ | |
| url: '/daotao/lops', | |
| success: function(data){ |
| <textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea> | |
| ... | |
| <textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea> | |
| ... | |
| <script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script> | |
| <script> | |
| // Hook up ACE editor to all textareas with data-editor attribute | |
| $(function () { |
| <head> | |
| <title>meteor_servercall</title> | |
| </head> | |
| <body> | |
| {{> simple}} | |
| {{> passData}} | |
| </body> | |
| <template name="simple"> |
| # Copyright (c) 2009, Sunlight Foundation | |
| # All rights reserved. | |
| # | |
| # Redistribution and use in source and binary forms, with or without modification, | |
| # are permitted provided that the following conditions are met: | |
| # | |
| # * Redistributions of source code must retain the above copyright notice, | |
| # this list of conditions and the following disclaimer. | |
| # * Redistributions in binary form must reproduce the above copyright notice, | |
| # this list of conditions and the following disclaimer in the documentation |
| # Optimized for writes, sort on read | |
| # LVC | |
| redis.hset("bonds|1", "bid_price", 96.01) | |
| redis.hset("bonds|1", "ask_price", 97.53) | |
| redis.hset("bonds|2", "bid_price", 95.50) | |
| redis.hset("bonds|2", "ask_price", 98.25) | |
| redis.sadd("bond_ids", 1) | |
| redis.sadd("bond_ids", 2) |