Skip to content

Instantly share code, notes, and snippets.

@jonpaul
Forked from tghastings/gist:2562214
Created April 30, 2012 20:05
Show Gist options
  • Save jonpaul/2562272 to your computer and use it in GitHub Desktop.
Save jonpaul/2562272 to your computer and use it in GitHub Desktop.
def update
@project = Project.find(params[:id])
@project.update_attributes!(params[:project])
respond_to do |format|
format.html do
if request.xhr?
# *** repond with the new value ***
render :text => params[:project].values.first
else
redirect_to(@project, :notice => 'User was successfully updated.')
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment