Hey there,
i have a simple conflict about trying to pass control from one
controller to another, but remembering which controller called it.
ok, i have users. each user has_one :pref (prefs is stuff like phone,
email, etc)
each user also has_many :accounts
so accounts and prefs belong_to :user
what i am trying to do is test if a prefs row has been created for the
user, if not, there needs to be a notification to create this row for
the user. I got that, and when i have the link_to go to the
pref_controller.rb, it works and the form from the scaffold loads ( i
point it to the new action )
when i hit submit though, it tells me that it cannot find the user
without id.
i guess my question is, how do i pass the user info to the pref
controller so that it knows to add the prefs record with the right
user_id ?
and i am wondering what to put in the scaffold of each to make sure
that the Site is remembered when created as the owner / parent of that
farm_stat or site_note
farm_stats are only one per site and contain stuff like what crop,
location, so on
site_notes i intend to be just a note taking app where the user can add
notes (almost like the blog app from the 15 minute tutorial )
so, i don’t know how to modify the code in my two scaffolds
thanks
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.