Class: BookmarkStatsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- BookmarkStatsController
- Defined in:
- app/controllers/bookmark_stats_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /bookmark_stats POST /bookmark_stats.json.
-
#destroy ⇒ Object
DELETE /bookmark_stats/1 DELETE /bookmark_stats/1.json.
-
#edit ⇒ Object
GET /bookmark_stats/1/edit.
-
#index ⇒ Object
GET /bookmark_stats GET /bookmark_stats.json.
-
#new ⇒ Object
GET /bookmark_stats/new GET /bookmark_stats/new.json.
-
#show ⇒ Object
GET /bookmark_stats/1 GET /bookmark_stats/1.json.
-
#update ⇒ Object
PUT /bookmark_stats/1 PUT /bookmark_stats/1.json.
Instance Method Details
#create ⇒ Object
POST /bookmark_stats POST /bookmark_stats.json
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'app/controllers/bookmark_stats_controller.rb', line 51 def create @bookmark_stat = BookmarkStat.new(bookmark_stat_params) respond_to do |format| if @bookmark_stat.save format.html { redirect_to @bookmark_stat, notice: t('controller.successfully_created', model: t('activerecord.models.bookmark_stat')) } format.json { render json: @bookmark_stat, status: :created, location: @bookmark_stat } else format.html { render action: "new" } format.json { render json: @bookmark_stat.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /bookmark_stats/1 DELETE /bookmark_stats/1.json
81 82 83 84 85 86 87 88 |
# File 'app/controllers/bookmark_stats_controller.rb', line 81 def destroy @bookmark_stat.destroy respond_to do |format| format.html { redirect_to bookmark_stats_url } format.json { head :no_content } end end |
#edit ⇒ Object
GET /bookmark_stats/1/edit
46 47 |
# File 'app/controllers/bookmark_stats_controller.rb', line 46 def edit end |
#index ⇒ Object
GET /bookmark_stats GET /bookmark_stats.json
8 9 10 11 12 13 14 15 |
# File 'app/controllers/bookmark_stats_controller.rb', line 8 def index @bookmark_stats = BookmarkStat.page(params[:page]) respond_to do |format| format.html # index.html.erb format.json { render json: @bookmark_stats } end end |
#new ⇒ Object
GET /bookmark_stats/new GET /bookmark_stats/new.json
36 37 38 39 40 41 42 43 |
# File 'app/controllers/bookmark_stats_controller.rb', line 36 def new @bookmark_stat = BookmarkStat.new respond_to do |format| format.html # new.html.erb format.json { render json: @bookmark_stat } end end |
#show ⇒ Object
GET /bookmark_stats/1 GET /bookmark_stats/1.json
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/bookmark_stats_controller.rb', line 19 def show if params[:format] == 'txt' per_page = 65534 else per_page = BookmarkStatHasManifestation.default_per_page end @stats = @bookmark_stat.bookmark_stat_has_manifestations.order('bookmarks_count DESC, manifestation_id').page(params[:page]).per(per_page) respond_to do |format| format.html # show.html.erb format.json { render json: @bookmark_stat } format.txt end end |
#update ⇒ Object
PUT /bookmark_stats/1 PUT /bookmark_stats/1.json
67 68 69 70 71 72 73 74 75 76 77 |
# File 'app/controllers/bookmark_stats_controller.rb', line 67 def update respond_to do |format| if @bookmark_stat.update_attributes(bookmark_stat_params) format.html { redirect_to @bookmark_stat, notice: t('controller.successfully_updated', model: t('activerecord.models.bookmark_stat')) } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @bookmark_stat.errors, status: :unprocessable_entity } end end end |