Sha256: 1ec4da497d6091a3b48e0c32ff127bbd5c50b1912babe667e08ce793541e9895
Contents?: true
Size: 727 Bytes
Versions: 5
Compression:
Stored size: 727 Bytes
Contents
class PhoneAccessCardsController < ApplicationController layout false, only: [:create, :update] before_action :set_access_card, only: [:update, :destroy] def create @access_card = PhoneAccessCard.new(access_card_params) if @access_card.save @result = :ok else @result = :fail end end def destroy @access_card.destroy end private # Use callbacks to share common setup or constraints between actions. def set_access_card @access_card = PhoneAccessCard.find(params[:id]) end # Never trust parameters from the scary internet, only allow the white list through. def access_card_params params.require(:phone_access_card).permit(:user_id, :value, :active) end end
Version data entries
5 entries across 5 versions & 1 rubygems