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
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
>
>
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
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
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
5 matches
Mail list logo