Skip to content

Instantly share code, notes, and snippets.

@rosslazer
Created February 24, 2013 05:11
Show Gist options
  • Save rosslazer/5022702 to your computer and use it in GitHub Desktop.
Save rosslazer/5022702 to your computer and use it in GitHub Desktop.
def new_item
@tool = Tool.new
@tool = Tool.new(params[:params])
respond_to do |format|
if @tool.save
format.json { render :json => @tool, :status => :created, :tool => @tool }
else
format.json { render :json => @tool.errors, :status => :unprocessable_entity }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment