John Merlino wrote:
> I can't imagine what I'm trying to do is complicated at all in Rails.
> Yet, I am now getting this error: undefined method `state' for
> :StudentFailState:Symbol.
> 
> student.rb
> has_one :student_fail
> attr_accessor :student_fail_attribute
> 
> #controller
> def student_fail
> @student = @student.find params[:id]
> 
> def update_student_fail
>   @student.build_student_fail params[:student][:student_fail_attribute]
>   if @student.save
> 
> #view
>            form_for @student do |f| f.collection_select(
> :student_fail_attribute, params[:StudentFailState.state], params[:id],
> params[:key]) end
> 
> true is an attribute of the StudentFailState table. There are three
> records in that table. So in the dropdown it will display the text (key
> attribute) of each table and each table will have an id.
> 
> Any suggestions? Thanks.

Yes.  Put Rails aside for a few days and focus on learning Ruby.  You're 
making an elementary syntax error.  If you can't see it, then you don't 
yet know Ruby well enough to use Rails profitably.

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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-t...@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