OSDN Git Service
(root)
/
pettanr
/
pettanr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
list browser created
[pettanr/pettanr.git]
/
app
/
controllers
/
system_pictures_controller.rb
diff --git
a/app/controllers/system_pictures_controller.rb
b/app/controllers/system_pictures_controller.rb
index
c671774
..
8843d8d
100644
(file)
--- a/
app/controllers/system_pictures_controller.rb
+++ b/
app/controllers/system_pictures_controller.rb
@@
-1,5
+1,6
@@
class SystemPicturesController < ApplicationController
class SystemPicturesController < ApplicationController
- before_filter :authenticate_admin!, :except => [:index, :show]
+ before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse, :create, :update, :destroy]
private
private
@@
-57,22
+58,25
@@
class SystemPicturesController < ApplicationController
end
end
end
end
- # GET /system_pictures/new
- # GET /system_pictures/new.json
- def new
- @system_picture = SystemPicture.new
+ def list
+ @system_pictures = SystemPicture.all
respond_to do |format|
respond_to do |format|
- format.html
# new.html.erb
- format.json { render json: @system_picture }
+ format.html
{ render layout: 'system' }
+ format.json { render json: @system_picture
s
}
end
end
end
end
- # GET /system_pictures/1/edit
- def edit
+ def browse
@system_picture = SystemPicture.find(params[:id])
@system_picture = SystemPicture.find(params[:id])
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @system_picture}
+ end
end
end
+
# POST /system_pictures
# POST /system_pictures.json
def create
# POST /system_pictures
# POST /system_pictures.json
def create