Wednesday, March 21, 2012

[Rails] Re: Re: @model OR :model in a form_for

Hi Javier,

you are right I just added it anyway when I reloaded the page now I have
another error

undefined method `basket' for #<Table id: nil, created_at: nil,
updated_at: nil>

I edit the basket and apple controller with

def index

@basket = Basket.find(:all)

end


def index

@apple = Apple.find(:all)

end

but I have always the same error

thanks

C

Javier Quarite wrote in post #1052696:
> If you are going to use @table in index.html.erb (that is handled by def
> index ) you have to add to the index method
>
> def index
>
> ....
> @table = Table.new
> end
>
> but I don't know why does it works with the symbol and not with the
> instance
>
> Javier Q.

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate