Hmm! If the I Sign in to the site. I type the url "mysite.com/galleries"
I get a different error
"undefined method `elseif' for #<GalleriesController:0x3517a18>"
Mohammad Abed wrote:
> This is line 8
> "elseif current_user.id.to_s == params[:user_id]"
>
> And here is the code form the start of the file to the end of the index
> method.
>
> class GalleriesController < ApplicationController
> #before_filter :require_user, :only => [:new, :create, :edit, :update,
> :destroy]
>
> def index
>
> if params[:user_id].blank?
> @galleries = Gallery.find(:all)
> elseif current_user.id.to_s == params[:user_id]
> @galleries = current_user.galleries
> else
> @user = User.find(params[:user_id])
> @galleries = @user.visible_galleries
> end
>
> respond_to do |format|
> format.html # index.html.erb
> format.xml { render :xml => @galleries }
> end
--
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
-~----------~----~----~----~------~----~------~--~---