Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 206
- Log:
Initial import of Gullery, an open source photo gallery:
http://nubyonrails.com/pages/gullery
- Author:
- rool
- Date:
- Sun May 20 19:05:59 +0100 2007
- Size:
- 999 Bytes
1 | class AssetsController < ApplicationController |
2 | |
3 | before_filter :login_required |
4 | |
5 | def create |
6 | @asset = Asset.new @params[:asset] |
7 | @asset.position = Asset.count |
8 | if @asset.save |
9 | redirect_to projects_url(:action => 'show', :id => @asset.project_id) |
10 | else |
11 | render :inline => "<%= error_messages_for :asset %>" |
12 | end |
13 | end |
14 | |
15 | def destroy |
16 | @asset = Asset.find @params[:id] |
17 | @asset.destroy |
18 | end |
19 | |
20 | def update_caption |
21 | @asset = Asset.find @params[:id] |
22 | @asset.caption = @params[:value] |
23 | if @asset.save |
24 | render :text => textilight(@asset.caption) |
25 | end |
26 | end |
27 | |
28 | def sort |
29 | asset_ids = @params[:asset_list] |
30 | asset_ids.each_with_index do |asset_id, index| |
31 | asset = Asset.find asset_id |
32 | asset.update_attribute(:position, index) |
33 | end |
34 | render :nothing => true |
35 | end |
36 | |
37 | def rotate |
38 | @asset = Asset.find @params[:id] |
39 | @asset.rotate(@params[:direction]) |
40 | redirect_to projects_url(:action => 'show', :id => @asset.project_id) |
41 | end |
42 | |
43 | end |