Re: [Rails] error in runtime controller#view

2012-07-04 Thread Colin Law
On 4 July 2012 05:23, rocky wrote: > m getting an error "Called id for nil, which would mistakenly be 4 -- if you > really wanted the id of nil, use object_id" > > when i'm creating new record,like a topic has many discussions,when i'm > creating a new discussions m getting that error..i already a

Re: [Rails] error in runtime controller#view

2012-07-04 Thread Michael Pavling
On 4 July 2012 07:14, Abhishek Sharma wrote: > class PageController < ApplicationController > > before_filter :find_subject > > def new > @page = Page.new(:subject_id => @subject.id) > @page_count = @subject.pages.size + 1 > @subjects = Subject.order('position ASC') > end > >

Re: [Rails] error in runtime controller#view

2012-07-03 Thread Abhishek Sharma
subjects has many pages subject controller code:: class SubjectController < ApplicationController def list @subjects = Subject.order("subjects.position ASC") end def show @subject = Subject.find(params[:id]) end def new @subject = Subject.new(:visible => 'false') @subject_count = Subject.count

Re: [Rails] error in runtime controller#view

2012-07-03 Thread radhames brito
On Wed, Jul 4, 2012 at 12:23 AM, rocky wrote: > m getting an error "Called id for nil, which would mistakenly be 4 -- if you > really wanted the id of nil, use object_id" > > when i'm creating new record,like a topic has many discussions,when i'm > creating a new discussions m getting that erro

[Rails] error in runtime controller#view

2012-07-03 Thread rocky
m getting an error "Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id" when i'm creating new record,like a topic has many discussions,when i'm creating a new discussions m getting that error..i already assign the topic id as foreign key in dis