Created
January 4, 2009 02:07
-
-
Save patrickberkeley/42981 to your computer and use it in GitHub Desktop.
This file contains 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 change_main_image | |
project = Project.find(params[:id]) | |
image = Image.find(params[:image_id]) | |
render :partial => 'main_image', :locals => {:project => project, :image => image} | |
end | |
def sort_images | |
@project = Project.find(params[:id]) | |
@project.images.each do |image| | |
# we must add one to compensate for the zero based index. | |
image.position = params["project_#{@project.id}_thumbnails"].index(image.id.to_s) + 1 | |
image.save | |
end | |
render :nothing => true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment