I''ve a field in my two db tables called "username". when I try to match post author and current username for editing a post @movies.username==current.name in my moviescontroller. It showed nil class or method. Why this is showing??Any ideas?? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Pzrv_2zaLDIJ. For more options, visit https://groups.google.com/groups/opt_out.
On 16 July 2012 20:52, Adnan <adnan.ayon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve a field in my two db tables called "username". when I try to match post > author and current username for editing a post > @movies.username==current.name in my moviescontroller. It showed nil class > or method. Why this is showing??Any ideas??Check what the values for both "@movies" and "current" are at this line. What are they? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 16 July 2012 20:57, Michael Pavling <pavling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 16 July 2012 20:52, Adnan <adnan.ayon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> I''ve a field in my two db tables called "username". when I try to match post >> author and current username for editing a post >> @movies.username==current.name in my moviescontroller. It showed nil class >> or method. Why this is showing??Any ideas?? > > Check what the values for both "@movies" and "current" are at this > line. What are they?If you don''t know how to do that have a look at the Rails Guide on Debugging. Colin -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.