Class: ManifestationCheckoutStatsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ManifestationCheckoutStatsController
- Defined in:
- app/controllers/manifestation_checkout_stats_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /manifestation_checkout_stats POST /manifestation_checkout_stats.json.
-
#destroy ⇒ Object
DELETE /manifestation_checkout_stats/1 DELETE /manifestation_checkout_stats/1.json.
-
#edit ⇒ Object
GET /manifestation_checkout_stats/1/edit.
-
#index ⇒ Object
GET /manifestation_checkout_stats GET /manifestation_checkout_stats.json.
-
#new ⇒ Object
GET /manifestation_checkout_stats/new GET /manifestation_checkout_stats/new.json.
-
#show ⇒ Object
GET /manifestation_checkout_stats/1 GET /manifestation_checkout_stats/1.json.
-
#update ⇒ Object
PUT /manifestation_checkout_stats/1 PUT /manifestation_checkout_stats/1.json.
Instance Method Details
#create ⇒ Object
POST /manifestation_checkout_stats POST /manifestation_checkout_stats.json
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'app/controllers/manifestation_checkout_stats_controller.rb', line 46 def create @manifestation_checkout_stat = ManifestationCheckoutStat.new(params[:manifestation_checkout_stat]) respond_to do |format| if @manifestation_checkout_stat.save flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.manifestation_checkout_stat')) format.html { redirect_to @manifestation_checkout_stat } format.json { render :json => @manifestation_checkout_stat, :status => :created, :location => @manifestation_checkout_stat } else format.html { render :action => "new" } format.json { render :json => @manifestation_checkout_stat.errors, :status => :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /manifestation_checkout_stats/1 DELETE /manifestation_checkout_stats/1.json
78 79 80 81 82 83 84 85 |
# File 'app/controllers/manifestation_checkout_stats_controller.rb', line 78 def destroy @manifestation_checkout_stat.destroy respond_to do |format| format.html { redirect_to manifestation_checkout_stats_url } format.json { head :no_content } end end |
#edit ⇒ Object
GET /manifestation_checkout_stats/1/edit
41 42 |
# File 'app/controllers/manifestation_checkout_stats_controller.rb', line 41 def edit end |
#index ⇒ Object
GET /manifestation_checkout_stats GET /manifestation_checkout_stats.json
7 8 9 10 11 12 13 14 |
# File 'app/controllers/manifestation_checkout_stats_controller.rb', line 7 def index @manifestation_checkout_stats = ManifestationCheckoutStat.page(params[:page]) respond_to do |format| format.html # index.html.erb format.json { render :json => @manifestation_checkout_stats } end end |
#new ⇒ Object
GET /manifestation_checkout_stats/new GET /manifestation_checkout_stats/new.json
31 32 33 34 35 36 37 38 |
# File 'app/controllers/manifestation_checkout_stats_controller.rb', line 31 def new @manifestation_checkout_stat = ManifestationCheckoutStat.new respond_to do |format| format.html # new.html.erb format.json { render :json => @manifestation_checkout_stat } end end |
#show ⇒ Object
GET /manifestation_checkout_stats/1 GET /manifestation_checkout_stats/1.json
18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/manifestation_checkout_stats_controller.rb', line 18 def show CheckoutStatHasManifestation.per_page = 65534 if params[:format] == 'csv' @stats = @manifestation_checkout_stat.checkout_stat_has_manifestations.order('checkouts_count DESC, manifestation_id').page(params[:page]) respond_to do |format| format.html # show.html.erb format.json { render :json => @manifestation_checkout_stat } format.csv end end |
#update ⇒ Object
PUT /manifestation_checkout_stats/1 PUT /manifestation_checkout_stats/1.json
63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'app/controllers/manifestation_checkout_stats_controller.rb', line 63 def update respond_to do |format| if @manifestation_checkout_stat.update_attributes(params[:manifestation_checkout_stat]) flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.manifestation_checkout_stat')) format.html { redirect_to @manifestation_checkout_stat } format.json { head :no_content } else format.html { render :action => "edit" } format.json { render :json => @manifestation_checkout_stat.errors, :status => :unprocessable_entity } end end end |