Sha256: f899e6401becee48702b41ffd154b621b62df2bb9dbabe83d95496b1fd27ddc3

Contents?: true

Size: 793 Bytes

Versions: 5

Compression:

Stored size: 793 Bytes

Contents

class NicknameAccessCardsController < ApplicationController
  layout false, only: [:create, :update]
  before_action :set_access_card, only: [:update, :destroy]

  def create
    if edit_checkout @access_card
      @access_card = NicknameAccessCard.new(access_card_params)
      if @access_card.save
        @result = :ok
      else
        @result = :fail
      end
    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 = NicknameAccessCard.find(params[:id])
  end

  # Never trust parameters from the scary internet, only allow the white list through.
  def access_card_params
    params.require(:nickname_access_card).permit(:user_id, :value, :active)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
digital_heroes_startkit-0.1.1.4 app/controllers/nickname_access_cards_controller.rb
digital_heroes_startkit-0.1.1.3 app/controllers/nickname_access_cards_controller.rb
digital_heroes_startkit-0.1.1.2 app/controllers/nickname_access_cards_controller.rb
digital_heroes_startkit-0.1.1.1 app/controllers/nickname_access_cards_controller.rb
digital_heroes_startkit-0.1.1 app/controllers/nickname_access_cards_controller.rb