Class: Admin::PlatePurposesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::PlatePurposesController
- Defined in:
- app/controllers/admin/plate_purposes_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
rubocop:todo Metrics/AbcSize, Metrics/MethodLength.
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
rubocop:todo Metrics/AbcSize, Metrics/MethodLength
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'app/controllers/admin/plate_purposes_controller.rb', line 38 def create # rubocop:todo Metrics/AbcSize, Metrics/MethodLength @plate_purpose = PlatePurpose.new(params[:plate_purpose]) respond_to do |format| if @plate_purpose.save flash[:notice] = 'Plate Purpose was successfully created.' format.html { redirect_to(admin_plate_purposes_path) } format.xml { render xml: @plate_purpose, status: :created, location: @plate_purpose } else format.html { render action: 'new' } format.xml { render xml: @plate_purpose.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
66 67 68 69 70 71 72 73 |
# File 'app/controllers/admin/plate_purposes_controller.rb', line 66 def destroy @plate_purpose.destroy respond_to do |format| format.html { redirect_to(admin_plate_purposes_url) } format.xml { head :ok } end end |
#edit ⇒ Object
35 36 |
# File 'app/controllers/admin/plate_purposes_controller.rb', line 35 def edit end |
#index ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/admin/plate_purposes_controller.rb', line 9 def index plate_purposes = PlatePurpose.all @plate_purposes = plate_purposes.map { |purpose| purpose.becomes(PlatePurpose) } respond_to do |format| format.html format.xml { render xml: @plate_purposes } end end |
#new ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'app/controllers/admin/plate_purposes_controller.rb', line 26 def new @plate_purpose = PlatePurpose.new respond_to do |format| format.html format.xml { render xml: @plate_purpose } end end |
#show ⇒ Object
19 20 21 22 23 24 |
# File 'app/controllers/admin/plate_purposes_controller.rb', line 19 def show respond_to do |format| format.html format.xml { render xml: @plate_purpose } end end |
#update ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'app/controllers/admin/plate_purposes_controller.rb', line 53 def update respond_to do |format| if @plate_purpose.update(params[:plate_purpose]) flash[:notice] = 'Plate Purpose was successfully updated.' format.html { redirect_to(admin_plate_purposes_path) } format.xml { head :ok } else format.html { render action: 'edit' } format.xml { render xml: @plate_purpose.errors, status: :unprocessable_entity } end end end |