Skip to content

Instantly share code, notes, and snippets.

View tghastings's full-sized avatar
🎯
Focusing

Tom Hastings tghastings

🎯
Focusing
View GitHub Profile
@tghastings
tghastings / Dockerfile
Last active July 16, 2018 00:37
Dockerfile Cloud9 Django
FROM bizcapdev/base-python-alpine-django
RUN apk --update add build-base g++ make curl wget openssl-dev apache2-utils git libxml2-dev sshfs nodejs bash tmux sqlite-dev postgresql-dev mysql-dev supervisor \
&& rm -f /var/cache/apk/* \
&& git clone https://github.com/c9/core.git /cloud9 \
&& cd cloud9 \
&& curl -s -L https://raw.githubusercontent.com/c9/install/master/link.sh | bash \
&& /cloud9/scripts/install-sdk.sh \
&& sed -i -e 's_127.0.0.1_0.0.0.0_g' /cloud9/configs/standalone.js \
&& mkdir /workspace \
####
source /usr/share/git-core/contrib/completion/git-prompt.sh
#
# Set the prompt #
#
# Select git info displayed, see /usr/lib/git-core/git-sh-prompt for more
export GIT_PS1_SHOWDIRTYSTATE=1 # '*'=unstaged, '+'=staged
export GIT_PS1_SHOWSTASHSTATE=1 # '$'=stashed
export GIT_PS1_SHOWUNTRACKEDFILES=1 # '%'=untracked
export GIT_PS1_SHOWUPSTREAM="verbose" # 'u='=no difference, 'u+1'=ahead by 1 commit
// Place your settings in this file to overwrite the default settings
{
"editor.renderLineHighlight": "none",
"editor.renderWhitespace": "all",
"workbench.iconTheme": "vs-minimal",
"editor.dragAndDrop": true,
}
def update
@project = Project.find(params[:id])
@project.update_attributes!(params[:project])
format.html {
if request.xhr?
# *** repond with the new value ***
render :text => params[:project].values.first
else
redirect_to(@project, :notice => 'User was successfully updated.')
Parameters: {"project"=>{"title"=>"dfdf"}, "id"=>"2"}
Project Load (0.1ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = ? LIMIT 1 [["id", "2"]]
(0.0ms) begin transaction
(0.2ms) UPDATE "projects" SET "title" = 'dfdf', "updated_at" = '2012-04-30 19:46:43.332038' WHERE "projects"."id" = 2
(6.1ms) commit transaction
Completed 500 Internal Server Error in 10ms
ArgumentError (too few arguments):
app/controllers/projects_controller.rb:65:in `format'
app/controllers/projects_controller.rb:65:in `update'
## show.html.erb
<p>
<b>Title:</b>
<%= editable_field @project, :title %>
</p>
<p>
##project_controller.rb