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
temp
[pettanr/pettanr.git]
/
app
/
controllers
/
comics_controller.rb
diff --git
a/app/controllers/comics_controller.rb
b/app/controllers/comics_controller.rb
index
e7a071d
..
617439a
100644
(file)
--- a/
app/controllers/comics_controller.rb
+++ b/
app/controllers/comics_controller.rb
@@
-10,30
+10,26
@@
class ComicsController < ApplicationController
end
before_filter :authenticate_admin!, :only => [:list, :browse]
end
before_filter :authenticate_admin!, :only => [:list, :browse]
- def top
- respond_to do |format|
- format.html
- end
- end
-
+ @@model = Comic
def index
def index
- @page = Comic.page params[:page]
- @page_size = Comic.page_size params[:page_size]
- @comics = Comic.list(@page, @page_size)
+ set_filer
+
respond_to do |format|
respond_to do |format|
- format
.html # index.html.erb
- format.json { render json: @
comics.to_json(Comic
.list_json_opt) }
+ format
_filer format
+ format.json { render json: @
items.to_json(@@model
.list_json_opt) }
format.atom
format.rss
end
end
def show
format.atom
format.rss
end
end
def show
- @comic = Comic.show(params[:id], [@user, @admin])
-
+ @item = Comic.show(params[:id], @operators)
respond_to do |format|
respond_to do |format|
- format.html # show.html.erb
- format.json { render json: @comic.to_json(Comic.show_json_opt) }
+ format.html {
+ @comic = @item
+ }
+ format_prof format
+ format.json { render json: @item.to_json(Comic.show_json_opt) }
format.atom
format.rss
end
format.atom
format.rss
end
@@
-94,6
+90,7
@@
class ComicsController < ApplicationController
format.html { redirect_to @comic }
format.json { render json: @comic.to_json(Comic.show_json_opt), status: :created, location: @comic }
else
format.html { redirect_to @comic }
format.json { render json: @comic.to_json(Comic.show_json_opt), status: :created, location: @comic }
else
+ flash[:notice] = I18n.t('flash.notice.not_created', :model => Comic.model_name.human)
format.html { render action: "new" }
format.json { render json: @comic.errors, status: :unprocessable_entity }
end
format.html { render action: "new" }
format.json { render json: @comic.errors, status: :unprocessable_entity }
end
@@
-110,6
+107,7
@@
class ComicsController < ApplicationController
format.html { redirect_to @comic }
format.json { head :ok }
else
format.html { redirect_to @comic }
format.json { head :ok }
else
+ flash[:notice] = I18n.t('flash.notice.not_updated', :model => Comic.model_name.human)
format.html { render action: "edit" }
format.json { render json: @comic.errors, status: :unprocessable_entity }
end
format.html { render action: "edit" }
format.json { render json: @comic.errors, status: :unprocessable_entity }
end
@@
-121,7
+119,7
@@
class ComicsController < ApplicationController
respond_to do |format|
if @comic.destroy_with_story
flash[:notice] = I18n.t('flash.notice.destroyed', :model => Comic.model_name.human)
respond_to do |format|
if @comic.destroy_with_story
flash[:notice] = I18n.t('flash.notice.destroyed', :model => Comic.model_name.human)
- format.html { redirect_to '/home/comic' }
+ format.html { redirect_to '/home/comic
s
' }
format.json { head :ok }
else
flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => Comic.model_name.human)
format.json { head :ok }
else
flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => Comic.model_name.human)