Created
September 17, 2013 23:02
-
-
Save andyh/6601891 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Api::TradesController < ApplicationController | |
| respond_to :json | |
| def index | |
| render json: DataTable.new(Trade, params) | |
| end | |
| def create | |
| trade = Trade.new(safe_params) | |
| trade.save | |
| respond_with trade | |
| end | |
| def update | |
| # respond_with Trade.update(params[:id], safe_params) | |
| end | |
| private | |
| def safe_params | |
| params.permit(:name) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment