Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 321
- Log:
Sort Parts by name whenever Parts are listed in views.
- Author:
- rool
- Date:
- Fri Mar 18 14:39:24 +0000 2011
- Size:
- 615 Bytes
1 | class Admin::PartsController < AdminAreaController |
2 | |
3 | def index |
4 | @parts = Part.find(:all, :order => 'name ASC') |
5 | @part = Part.new(params[:part]) |
6 | |
7 | if request.post? && @part.save |
8 | redirect_to :action => 'index' |
9 | end |
10 | end |
11 | |
12 | def edit |
13 | @part = Part.find(params[:id]) |
14 | @part.attributes = params[:part] |
15 | if request.post? && @part.save |
16 | redirect_to :action => 'index' |
17 | end |
18 | end |
19 | |
20 | def delete |
21 | #if request.post? |
22 | part = Part.find(params[:id]) rescue nil |
23 | redirect_to :action => 'index' unless part |
24 | part.destroy |
25 | redirect_to :action => 'index' |
26 | #end |
27 | end |
28 | end |