mirror of
https://github.com/System-End/highway.git
synced 2026-04-19 16:28:24 +00:00
10 lines
No EOL
304 B
Ruby
10 lines
No EOL
304 B
Ruby
# app/controllers/prizes_controller.rb
|
|
class PrizesController < ApplicationController
|
|
before_action :require_authentication
|
|
|
|
def add_to_box
|
|
prize = Prize.find(params[:id])
|
|
current_user.user_prizes.create!(prize: prize)
|
|
redirect_to prizes_path, notice: "Added to your prize box!"
|
|
end
|
|
end |