Sha256: 860c5a03f1dc6f02411596466a3b5e2888f5536d555696e8fe085e5f90fa1e21
Contents?: true
Size: 542 Bytes
Versions: 4
Compression:
Stored size: 542 Bytes
Contents
class DismissibleBlocksController < ApplicationController def create if current_user_available unless current_user.dismissed_blocks.include?(block) current_user.dismissed_blocks.push(block) current_user.save! end render json: {}, status: :ok else render json: {}, status: :unprocessable_entity end end private def current_user_available respond_to?(:current_user) && current_user.respond_to?(:dismissed_blocks) end def block params[:block].to_s end end
Version data entries
4 entries across 4 versions & 1 rubygems