Created
December 28, 2011 09:46
-
-
Save Znow/1527365 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
| def create | |
| @stock = Stock.new(params[:stock]) | |
| @is = InvestorStock.new(params[:investor_id]) | |
| respond_to do |format| | |
| if @stock.save && @is.save | |
| format.html { redirect_to admin_stock_url(@stock), notice: 'Stock was successfully created.' } | |
| format.json { render json: @stock, status: :created, location: @stock } | |
| else | |
| format.html { render action: "new" } | |
| format.json { render json: @stock.errors, status: :unprocessable_entity } | |
| end | |
| end | |
| end |
pacso
commented
Dec 28, 2011
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment