# Forma de ingreso a Sutty class ApplicationController < ActionController::Base protect_from_forgery with: :exception # No tenemos índice de sutty, vamos directamente a ver el listado de # sitios def index redirect_to sites_path end private # Encontrar un sitio por su ID # TODO volverlo más natural a rails def find_site id = params[:site_id] || params[:id] current_user.sites.find do |s| s.id == id end end end