app/controllers/admin/tables_controller.rb
# We only require login for index, so we must manage the security at this level.
# we present different actions depending on if there is a user logged in or not.
# if the user is not logged in, we redirect them to the public page
We only require login for index, so we must manage the security at this level.
we present different actions depending on if there is a user logged in or not.
if the user is not logged in, we redirect them to the public page
We only require login for index so we must manage the security at this level . we present different actions depending on if there is a user logged in or not . if the user is not logged in we redirect them to the public page
def show
    if current_user.present?
      @table = Table.find_by_identifier(current_user.id, params[:id])
      respond_to do |format|
        format.html
        download_formats @table, format
      end
    else
      redirect_to public_table_path(params[:id], :format => params[:format])
    end
  end
def show if current_user . present? @table = Table . find_by_identifier ( current_user . id , params [ :id ] ) respond_to do | format | format . html download_formats @table , format end else redirect_to public_table_path ( params [ :id ] , :format => params [ :format ] ) end end
We only require login for index, so we must manage the security at this level.
We only require login for index so we must manage the security at this level .