You should check if @profile.galeries is nil first.
so maybe something like this...

@galeries = [ ]
@galeries = @profile.galeries if @profile.galeries.exsists?


On Dec 12, 2008, at 2:48 PM, nelson wrote:

>
> hi,
>
> i link the profile menu with a new model called 'galerie'.
>
> class Galerie < ActiveRecord::Base
>  has_many :photos
>  belongs_to :profile
> end
>
>
> class Profile < ActiveRecord::Base
>  ...
>  ...
>  has_many :galeries
> end
>
> But in the controller, i can't access to the galleries of a profile :
>  def setup
>    @user = @profile.user
>    @galerie = Galerie.new
>    @galeries = @profile.galeries  //Error
>    @photo = Photo.new
>  end
>
> I have always this error :
> NameError in GaleriesController#index
>
> uninitialized constant Profile::Galery
>
> Where the 'galery' comes from ?
>
> Thanks,
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Lovd by Less" 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/lovdbyless?hl=en
Who loves ya baby?
-~----------~----~----~----~------~----~------~--~---

Reply via email to