Hi,

I figured out this error

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

simply add two columns (apple & basket) in the table called Table :)

now appear correctly the webpage with the drop down menu so

If you have in the app/views/table/new.html.erb


1. <%= form_for @table do |f| %>
2. <%= f.collection_select(:basket, @basket, :id, :shape, {:prompt => 
true}) %>
3. <%= f.collection_select(:apple, @apple, :id, :color, {:prompt => 
true}) %>

it works but

A. in the model Table you have the follow code

def new

@apple = Apple.find(:all)
@Basket = Basket.find(:all)
@table = Table.new

end

B. in the table called 'Table' obviously you have 2 record 'apple' and 
''

NOW

even if I don't have the right code as letter A. and letter B. if I 
write in the line 1.

<%= form_for :table do |f| %>

and not

<%= form_for @table do |f| %>

the page appear correctly and load also the data from apple & basket 
table in the drop down menu

I don't know why but is only a doubt to understand the difference 
between a symbol and an instance

thanks a lot anyway



C

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

Reply via email to