# -*- encoding : utf-8 -*-

class Admin::MOdrProductRemisesController < ApplicationController
  layout "admin"
  before_action :auth_admin

  before_action :admin_space
  
  def admin_space
    @admin_space = "default"
  end
  
  def index
    @m_odr_product_remises = MOdrProductRemise.order(:name).all

  end

  def show
    @m_odr_product_remise = MOdrProductRemise.find(params[:id])

  end

  def new
    @m_odr_product_remise = MOdrProductRemise.new
  
  end

  def edit
    @m_odr_product_remise = MOdrProductRemise.find(params[:id])
    
  end

  def create
    @m_odr_product_remise = MOdrProductRemise.new(params.require(:m_odr_product_remise).permit!)

    if @m_odr_product_remise.save
      
    else
      render action: "new"
 
    end

  end


  def update
    @m_odr_product_remise = MOdrProductRemise.find(params[:id])


    if @m_odr_product_remise.update_attributes(params.require(:m_odr_product_remise).permit!)
      
    else
     render action: "edit" 
      
    end
      
  end


  def destroy
    @m_odr_product_remise = MOdrProductRemise.find(params[:id])
    @m_odr_product_remise.destroy
    
  end
end
