Skip to content

Instantly share code, notes, and snippets.

@matthooks
Created November 9, 2008 19:35
Show Gist options
  • Save matthooks/23327 to your computer and use it in GitHub Desktop.
Save matthooks/23327 to your computer and use it in GitHub Desktop.
def sort
params[:block].each_with_index do |id, pos|
Block.find(id).update_attribute(:position, pos+1)
end
head :ok
end
def index
@blocks = @page.blocks
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @blocks }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment