Hi all,

On a model named Packages, I was experimenting with a redirect to 
Packages#index in the event that a requested package wasn't found. It seems 
I'm missing something:

If I do this:

  def show
    @package = current_user.packages.find_by_id(params[:id])
    if @package.nil?
      flash[:error] = 'Package not found.'
      redirect_to :action => :index
    end       
  end

I get my desired result. But I'm supposed to call hobo_show to do 
permissions checking. 

Yet, if I do that:

  def show
    hobo_show do
      if @package.nil?
        flash[:error] = 'Package not found.'
        redirect_to :action => :index
      end      
  end

I simply get 

"Couldn't find Package with ID=xx"

What is the most appropriate Hoboish way to handle the case when a requested 
record isn't found? 

Thanks,
Tim

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to