Class: ManifestationReserveStatsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ManifestationReserveStatsController
- Defined in:
- app/controllers/manifestation_reserve_stats_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /manifestation_reserve_stats POST /manifestation_reserve_stats.json.
-
#destroy ⇒ Object
DELETE /manifestation_reserve_stats/1 DELETE /manifestation_reserve_stats/1.json.
-
#edit ⇒ Object
GET /manifestation_reserve_stats/1/edit.
-
#index ⇒ Object
GET /manifestation_reserve_stats GET /manifestation_reserve_stats.json.
-
#new ⇒ Object
GET /manifestation_reserve_stats/new GET /manifestation_reserve_stats/new.json.
-
#show ⇒ Object
GET /manifestation_reserve_stats/1 GET /manifestation_reserve_stats/1.json.
-
#update ⇒ Object
PUT /manifestation_reserve_stats/1 PUT /manifestation_reserve_stats/1.json.
Instance Method Details
#create ⇒ Object
POST /manifestation_reserve_stats POST /manifestation_reserve_stats.json
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'app/controllers/manifestation_reserve_stats_controller.rb', line 50 def create @manifestation_reserve_stat = ManifestationReserveStat.new(manifestation_reserve_stat_params) @manifestation_reserve_stat.user = current_user respond_to do |format| if @manifestation_reserve_stat.save Resque.enqueue(ManifestationReserveStatQueue, @manifestation_reserve_stat.id) format.html { redirect_to @manifestation_reserve_stat, notice: t('statistic.successfully_created', model: t('activerecord.models.manifestation_reserve_stat')) } format.json { render json: @manifestation_reserve_stat, status: :created, location: @manifestation_reserve_stat } else format.html { render action: "new" } format.json { render json: @manifestation_reserve_stat.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /manifestation_reserve_stats/1 DELETE /manifestation_reserve_stats/1.json
85 86 87 88 89 90 91 92 |
# File 'app/controllers/manifestation_reserve_stats_controller.rb', line 85 def destroy @manifestation_reserve_stat.destroy respond_to do |format| format.html { redirect_to manifestation_reserve_stats_url } format.json { head :no_content } end end |
#edit ⇒ Object
GET /manifestation_reserve_stats/1/edit
45 46 |
# File 'app/controllers/manifestation_reserve_stats_controller.rb', line 45 def edit end |
#index ⇒ Object
GET /manifestation_reserve_stats GET /manifestation_reserve_stats.json
7 8 9 10 11 12 13 14 |
# File 'app/controllers/manifestation_reserve_stats_controller.rb', line 7 def index @manifestation_reserve_stats = ManifestationReserveStat.page(params[:page]) respond_to do |format| format.html # index.html.erb format.json { render json: @manifestation_reserve_stats } end end |
#new ⇒ Object
GET /manifestation_reserve_stats/new GET /manifestation_reserve_stats/new.json
35 36 37 38 39 40 41 42 |
# File 'app/controllers/manifestation_reserve_stats_controller.rb', line 35 def new @manifestation_reserve_stat = ManifestationReserveStat.new respond_to do |format| format.html # new.html.erb format.json { render json: @manifestation_reserve_stat } end end |
#show ⇒ Object
GET /manifestation_reserve_stats/1 GET /manifestation_reserve_stats/1.json
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/manifestation_reserve_stats_controller.rb', line 18 def show if params[:format] == 'txt' per_page = 65534 else per_page = ReserveStatHasManifestation.default_per_page end @stats = @manifestation_reserve_stat.reserve_stat_has_manifestations.order('reserves_count DESC, manifestation_id').page(params[:page]).per(per_page) respond_to do |format| format.html # show.html.erb format.json { render json: @manifestation_reserve_stat } format.txt end end |
#update ⇒ Object
PUT /manifestation_reserve_stats/1 PUT /manifestation_reserve_stats/1.json
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'app/controllers/manifestation_reserve_stats_controller.rb', line 68 def update respond_to do |format| if @manifestation_reserve_stat.update_attributes(manifestation_reserve_stat_params) if @manifestation_reserve_stat.mode == 'import' Resque.enqueue(ManifestationReserveStatQueue, @manifestation_reserve_stat.id) end format.html { redirect_to @manifestation_reserve_stat, notice: t('controller.successfully_created', model: t('activerecord.models.manifestation_reserve_stat')) } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @manifestation_reserve_stat.errors, status: :unprocessable_entity } end end end |