Why would this not generate a 404 response?
def index
if find_user
@documents = @client.documents
respond_to do |format|
format.html
format.atom { render layout: false }
end
else
flash[:error] = "#{params[:client_code]} is not a client."
render 'error', status: '404'
end
end
def find_user
@client = User.find_by_client_code(params[:client_code]) if valid_user?
end
def valid_user?
User.all.each.map(&:client_code).include?(params[:client_code])
end
Like, if the code is incorrect it should return a 404, right? And not an exception? Can't quite get it to work.
EDIT: sorry, here's the error:
An ActionView::MissingTemplate occurred in share#index:
* Parameters : {"controller"=>"share", "action"=>"index", "client_code"=>"ampNDHEDD", "format"=>"atom"}