Thanks David, yeah, corrected to elsif, that doesn't work either!. I've 
something that works for the most part. The only case where my code 
doesn't work: If the user is signed-in, it does pull all the user 
gallery, I get the same galleries as if I called user.visible_galleries


if params[:user_id]
 @user = User.find(params[:user_id])
 @galleries = @user.visible_galleries
 elsif params[:user_id] && current_user && params[:user_id] == 
current_user.id
   @galleries = current_user.galleries
 else
  @galleries = Gallery.find(:all, :conditions => ['visibility_status = 
?', true])
    end



David A. Black wrote:
> Hi --
> 
> On Wed, 21 Jan 2009, Mohammad Abed wrote:
> 
>>
>> Hmm! If the I Sign in to the site. I type the url "mysite.com/galleries"
>> I get a different error
> 
> Getting a different error is always a hopeful sign :-)
> 
>> "undefined method `elseif' for #<GalleriesController:0x3517a18>"
> 
> It's elsif (no second e).
> 
> 
> David
> 
> --
> David A. Black / Ruby Power and Light, LLC
> Ruby/Rails consulting & training: http://www.rubypal.com
> Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2)
> 
> http://www.wishsight.com => Independent, social wishlist management!

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to